CVD
- Source: https://www.freebasic.net/wiki/wikka.php?wakka=KeyPgCvd
- Last revised: 2016-03-12
Converts a 64-bit integer or 8-byte string to a double-precision value
Syntax
vb
declare function Cvd ( byval l as longint ) as double
declare function Cvd ( byref str as const string ) as doubleUsage
result = Cvd( l )
result = Cvd( str )Parameters
l
A 64-bit Longint with a binary copy of a double-precision variable stored in it.
str
A String at least 8 bytes in length with a binary copy of a double-precision variable stored in it.
Return Value
Returns a Double value holding a binary copy of the input value.
Description
Does a binary copy from a 64-bit Longint or 8-byte String to a Double variable. A value of zero (0.0) is returned if the string is less than 8 bytes in length. The result will make sense only if the parameter contained a IEEE-754 formatted double-precision value, such as one generated by Cvlongint or Mkd.
This function is useful to read numeric values from buffers without using a Type definition.
Examples
start GeSHi
vb
Dim d As Double, l As LongInt
d = 1.125
l = CVLongInt(d)
Print Using "l = _&H&"; Hex(l)
Print Using "cvd(i) = &"; CVD(l)end GeSHi
Differences from QB
- QB did not support integer arguments.
See also
MkdCvsCvlongint
Back to DocToc