previous next top contents index framed top this page unframed
Figure 32–104. cvr (GENERIC)
| $BUILTIN COMPILETIME REAL PROCEDURE cvr (INTEGER x); $BUILTIN COMPILETIME REAL PROCEDURE cvr (LONG REAL x); REAL PROCEDURE cvr (STRING s); $BUILTIN COMPILETIME REAL PROCEDURE cvr (LONG INTEGER x); $BUILTIN COMPILETIME REAL PROCEDURE cvr (REAL x); |
cvr converts to REAL.
The (LONG) INTEGER forms convert x to a REAL with an equivalent mathematical value, provided that the value of x can be represented exactly as a REAL value; otherwise, the result is rounded or truncated in an unspecified direction.
The LONG REAL form converts x to a REAL with an equivalent mathematical value, provided that the value of x can be represented exactly as a REAL value. If x has too great a magnitude to be represented as a REAL, the result is undefined; overflow is not necessarily detected. If x does not have too great a magnitude to be represented as a REAL, but cannot be represented exactly as a REAL, it is rounded or truncated in an unspecified direction.
The REAL form returns its argument.
If s is a STRING, x := cvr(s) has the same effect as r := s; read(r,x), where r is a temporary STRING variable.
MAINSAIL Language Manual, Section 32.94