previous next top contents index framed top this page unframed
Figure 32–98. cvli (GENERIC)
| $BUILTIN COMPILETIME LONG INTEGER PROCEDURE cvli (INTEGER i); LONG INTEGER PROCEDURE cvli (STRING s); $BUILTIN COMPILETIME LONG INTEGER PROCEDURE cvli (BITS b); $BUILTIN LONG INTEGER PROCEDURE cvli (REAL x); $BUILTIN COMPILETIME LONG INTEGER PROCEDURE cvli (LONG BITS b); $BUILTIN LONG INTEGER PROCEDURE cvli (LONG REAL x); $BUILTIN LONG INTEGER PROCEDURE cvli (ADDRESS a); $BUILTIN COMPILETIME LONG INTEGER PROCEDURE cvli (LONG INTEGER ii); |
cvli converts to LONG INTEGER.
The INTEGER form converts to a different internal format, if necessary; the result has the same mathematical value as i.
The LONG INTEGER form returns its argument.
The (LONG) REAL forms round x to the nearest LONG INTEGER. If x is exactly halfway between two LONG INTEGERs (i.e., has a fraction of 0.5), the direction of rounding is unspecified. Overflow is not necessarily detected if the floating point number is outside the LONG INTEGER range.
The (LONG) BITS forms convert b to the LONG INTEGER with the corresponding bit pattern, zero-filling on the left if necessary.
If s is a STRING, i := cvli(s) has the same result as r := s; read(r,i), where r is a temporary STRING variable.
The ADDRESS form returns the LONG INTEGER corresponding to the bit pattern of a.
Example 32–99. Use of cvli
| cvli(10) = 10L cvli(310.5) = 310L or 311L (unspecified) cvli(-310.5) = -310L or -311L (unspecified) cvli('130) = 88L cvli("Result: 1087") = 1087L cvli(NULLADDRESS) = 0L |
MAINSAIL Language Manual, Section 32.91