The predicateextreme-float-p identifies extreme floating-point numbers. It returns one of the following values:

nil

This value indicates that the float argument is a normal or denormalized floating-point number.

:minus-infinity

This value indicates that the float argument is a negative infinity representation.

:plus-infinity

This value indicates that the float argument is a positive infinity representation.

:not-a-number

This value indicates that the float argument is an illegal value, the IEEE NaN condition.

The float argument must be a floating-point number.

integer-decode-floatFunction

Syntax:integer-decode-floatfloat

The functioninteger-decode-float returns three values:

The first value is the result of scaling the mantissa of float so that it is an integer. For single-precision numbers, the first value is a fixnum; otherwise, it lies between(expt 2 52) and(expt 2 53).

The second result is the integer exponent to which the radix must be raised to obtain the value that, when multiplied with the first result, produces the absolute value of the original float value.

The third result is 1 if float is greater than or equal to zero; otherwise it is -1.

The product of the first result ofinteger-decode-float multiplied by the radix raised to the power of the second result and then multiplied by the third result is exactly equal to the value of the argument.

Returning a fixnum when the first result is a single-precision number is an extension to the Common Lisp behavior for this function.

The functionround-to-single-precision rounds a double-precision number (64 bits) down to single-precision format (32 bits); it then reexpands the number to 64-bit size.

The number is stored and prints in 64-bit format.

This function allows you to model the rounding behavior of a machine or implementation that performs 32-bit floating arithmetic.

The default size and rounding mode for Liquid Common Lisp is 64 bits and round-to-nearest, as specified by the IEEE standard.

> pi
3.141592653589793

> (float-precision pi)
53

> (round-to-single-precision pi)
3.1415927410125732

> (float-precision (round-to-single-precision pi))
53

supported-floating-point-conditionsConstant

Syntax:supported-floating-point-conditions

The constantsupported-floating-point-conditions is a list of the floating-point trapping conditions. These conditions conform to the IEEE standard for detecting floating-point exceptions.

The following conditions are supported:

floating-point-underflow,floating-point-overflow

These conditions occur when the capacity of the floating-point exponent range is exceeded. The underflow condition also occurs with IEEE denormalization and is sometimes called gradual underflow.

floating-point-inexact

This condition occurs when rounding actually discards some nonzero bits, that is, when the capacity of the mantissa field is exceeded.

floating-point-invalid-operation

This condition occurs when an operand is not valid for the operation being performed, such as multiplying zero by infinity or dividing zero by zero.

For LCL/SunOS and LCL/Solaris, the conditionfloating-point-invalid-operation represents the union of three lower-level conditions supported by the MC68881 floating-point coprocessor; see the on-line filewizards.doc for more information.

division-by-zero

This condition occurs when an attempt is made to divide any nonzero number by zero.

The ability to continue past these conditions is hardware specific.

See the IEEE standard for binary floating-point arithmetic for more information.

The macrowith-floating-point-traps enables or disables floating-point traps during the execution of the macro body.

The body code specified by the form arguments is executed with a temporary change to the enabled floating-point traps. Those conditions specified in the enable-list argument are turned on, and those in the disable-list argument are turned off. The enable-list and disable-list arguments are evaluated.