Navigation bar
  Start Previous page
 66 of 283 
Next page End 61 62 63 64 65 66 67 68 69 70 71  

57
CSng
Type
Function returning Single
Invocation
CSng(arg)
Parameter
Method
Type
Description
arg
ByVal
numeric or Enum
The value to convert to Single.
Discussion
This function converts any numeric or enumeration value to a Single value.  For integral and Enum
types, the result will be the floating point approximation of the integral value.  If a Single type parameter
is supplied, the result is identical to the parameter value.  If a String type parameter is supplied, the
result will be the numeric value of the character string.  The form of the character representation
Example
Dim b as Byte
Dim f as Single
b = 21
f = CSng(b)
Compatibility
In BasicX, passing an UnsignedLong value larger than 2,147,483,647 erroneously generates a negative
Single result.  This implementation handles UnsignedLong values correctly.
Previous page Top Next page