-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathC2D.HELPREXX
40 lines (29 loc) · 1.25 KB
/
C2D.HELPREXX
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
C2D function
+-----------------------------------------------------------------------------+
| C2D(string, [length]) |
+-----------------------------------------------------------------------------+
Returns a decimal value from the binary representation of the string, within
the limits of the current value of NUMERIC DIGITS. The value depends upon
the optional length argument.
If the length is specified as 0, the value is always 0.
Examples:
C2D('003l'x,0) == 0
If the length is omitted, the string is interpreted as an unsigned number.
Examples:
C2D('09'x) == 9
C2D('8l'x) == 129
C2D('a') == 129
C2D('FF8l'x) == 65409
C2D (' ') == 0
If the length is specified, the left-most bit of the string is taken as the sign,
with 0 indicating a positive number and 1 negative. The rest of the string is
either left-extended to the specified number of characters with '00'x, or
truncated if it is smaller than the string.
Examples:
C2D('8l'x,l) == -127
C2D('8l'x,2) == 129
C2D('FF8l'x,2) == -127
C2D('FF8l'x,l) == -127
C2D('FF7F'x,l) == 127
C2D('F081'x,2) == -3967
C2D('F08l'x,l) == -127