Converts an eight-byte string to a $DOUBLE floating point number.
Description
The value that $ZDASCII returns depends on the arguments you use.
-
$ZDASCII(string) returns a $DOUBLE (IEEE floating point) numeric interpretation of an eight-byte string starting at the first character position of string.
-
$ZDASCII(string,position) returns a $DOUBLE (IEEE floating point) numeric interpretation of an eight-byte string beginning at the starting byte position specified by position.
$ZDASCII can return either a positive or a negative number.
$ZDASCII issues a <FUNCTION> error if string is less than eight bytes in length, if the specified position results in a remaining string of less than eight bytes, or if position is an invalid value.
Examples
The following example determines the numeric interpretation of the numeric 12345678:
WRITE $ZDASCII(12345678)
It returns: .000000000000000000000000000000000000068213200517013251261
The following examples also return the same value:
WRITE !,$ZDASCII("12345678",1)
WRITE !,$ZDASCII(++001234567899,1)
WRITE !,$ZDASCII("++001234567899",5)
The following example determines the numeric interpretation of the negative numeric –1234567. Note that the minus sign is counted as a byte:
WRITE $ZDASCII(-1234567)
It returns: .00000000000000000000000000000000000000000099583343788967399388
The following example determines the numeric interpretation of the character string “abcdefgh”:
WRITE $ZDASCII("abcdefgh")
It returns: 85408832230361244356000000000000000000000000000000000000000000000000000