ToC DocOverview CGDoc RelNotes Index PermutedIndex
Allegro CL
Home Previous Up Next Table of Contents Index
  ANSI Common Lisp   12 Numbers   12.2 Dictionary of Numbers

12.2.74 float Function

Syntax:
float number &optional prototype    float

Arguments and Values:
number - a real.

prototype - a float.

float - a float.

Description:
float converts a real number to a float.

If a prototype is supplied, a float is returned that is mathematically equal to number but has the same format as prototype.

If prototype is not supplied, then if the number is already a float, it is returned; otherwise, a float is returned that is mathematically equal to number but is a single float.

Examples:
 (float 0)  0.0
 (float 1 .5)  1.0
 (float 1.0)  1.0
 (float 1/2)  0.5
 1.0d0
OR1.0
 (eql (float 1.0 1.0d0) 1.0d0)  true

See Also:
coerce

Allegro CL Implementation Details:
None.

Home Previous Up Next Table of Contents Index
© Franz Inc. 1998-2015 - File last updated 03-23-2015