The float-features Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The float-features Reference Manual

This is the float-features Reference Manual, version 1.0.0, generated automatically by Declt version 3.0 "Montgomery Scott" on Mon Apr 19 16:05:05 2021 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

About Float-Features

This is a wrapper library for IEEE floating point features not present in the Common Lisp standard.

Implementation Support

The following implementations are currently partially or entirely supported:


Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 float-features

Maintainer

Nicolas Hafner <shinmera@tymoon.eu>

Author

Nicolas Hafner <shinmera@tymoon.eu>

Home Page

https://github.com/Shinmera/float-features

License

zlib

Description

A portability library for IEEE float features not covered by the CL standard.

Version

1.0.0

Dependency

documentation-utils

Source

float-features.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 float-features.asd

Location

float-features.asd

Systems

float-features (system)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.2 float-features/float-features.lisp

Parent

float-features (system)

Location

float-features.lisp

Packages

float-features

Exported Definitions
Internal Definitions

keep (function)


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.3 float-features/documentation.lisp

Dependency

float-features.lisp (file)

Parent

float-features (system)

Location

documentation.lisp


Previous: , Up: Lisp files   [Contents][Index]

3.1.4 float-features/nan.lisp

Dependency

documentation.lisp (file)

Parent

float-features (system)

Location

nan.lisp

Exported Definitions

Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Previous: , Up: Packages   [Contents][Index]

4.1 float-features

Source

float-features.lisp (file)

Nickname

org.shirakumo.float-features

Use List

common-lisp

Exported Definitions
Internal Definitions

keep (function)


Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Constants

Constant: double-float-nan

A positive quiet NaN value with zero-cleared payload for double-floats.
This value should NOT be used for comparison with a float value for the pupose of testing NaN
because NaN has unused bits (called payload) which are explicitly allowed to store additional information. Comparing this value with other NaN representations via = will fail.
To test if a number is a NaN, use FLOAT-NAN-P.

It is supported on implementations which support BITS-DOUBLE-FLOAT.

Defaults to MOST-POSITIVE-DOUBLE-FLOAT on unsupported implementations.

Package

float-features

Source

nan.lisp (file)

Constant: double-float-negative-infinity

The negative infinity for double-floats.

Supported on:
* ABCL
* ALLEGRO
* CCL
* CMUCL
* ECL
* LISPWORKS
* MEZZANO
* MKCL
* SBCL

Defaults to MOST-NEGATIVE-DOUBLE-FLOAT on unsupported implementations.

Package

float-features

Source

float-features.lisp (file)

Constant: double-float-positive-infinity

The positive infinity for double-floats.

Supported on:
* ABCL
* ALLEGRO
* CCL
* CMUCL
* ECL
* LISPWORKS
* MEZZANO
* MKCL
* SBCL

Defaults to MOST-POSITIVE-DOUBLE-FLOAT on unsupported implementations.

Package

float-features

Source

float-features.lisp (file)

Constant: long-float-negative-infinity

The negative infinity for long-floats.

Supported on:
* CCL
* CMUCL
* ECL
* LISPWORKS
* MEZZANO
* MKCL
* SBCL

Defaults to MOST-NEGATIVE-LONG-FLOAT on unsupported implementations.

Package

float-features

Source

float-features.lisp (file)

Constant: long-float-positive-infinity

The positive infinity for long-floats.

Supported on:
* CCL
* CMUCL
* ECL
* LISPWORKS
* MEZZANO
* MKCL
* SBCL

Defaults to MOST-POSITIVE-LONG-FLOAT on unsupported implementations.

Package

float-features

Source

float-features.lisp (file)

Constant: short-float-nan

A positive quiet NaN value with zero-cleared payload for short-floats.
This value should NOT be used for comparison with a float value for the pupose of testing NaN
because NaN has unused bits (called payload) which are explicitly allowed to store additional information. Comparing this value with other NaN representations via = will fail.
To test if a number is a NaN, use FLOAT-NAN-P.

It is supported on implementations which support BITS-SHORT-FLOAT.

Defaults to MOST-POSITIVE-SHORT-FLOAT on unsupported implementations.

Package

float-features

Source

nan.lisp (file)

Constant: short-float-negative-infinity

The negative infinity for short-floats.

Supported on:
* ALLEGRO
* CCL
* CMUCL
* ECL
* LISPWORKS
* MEZZANO
* MKCL
* SBCL

Defaults to MOST-NEGATIVE-SHORT-FLOAT on unsupported implementations.

Package

float-features

Source

float-features.lisp (file)

Constant: short-float-positive-infinity

The positive infinity for short-floats.

Supported on:
* ALLEGRO
* CCL
* CMUCL
* ECL
* LISPWORKS
* MEZZANO
* MKCL
* SBCL

Defaults to MOST-POSITIVE-SHORT-FLOAT on unsupported implementations.

Package

float-features

Source

float-features.lisp (file)

Constant: single-float-nan

A positive quiet NaN value with zero-cleared payload for single-floats.
This value should NOT be used for comparison with a float value for the pupose of testing NaN
because NaN has unused bits (called payload) which are explicitly allowed to store additional information. Comparing this value with other NaN representations via = will fail.
To test if a number is a NaN, use FLOAT-NAN-P.

It is supported on implementations which support BITS-SINGLE-FLOAT.

Defaults to MOST-POSITIVE-SINGLE-FLOAT on unsupported implementations.

Package

float-features

Source

nan.lisp (file)

Constant: single-float-negative-infinity

The negative infinity for single-floats.

Supported on:
* ABCL
* ALLEGRO
* CCL
* CMUCL
* ECL
* LISPWORKS
* MEZZANO
* MKCL
* SBCL

Defaults to MOST-NEGATIVE-SINGLE-FLOAT on unsupported implementations.

Package

float-features

Source

float-features.lisp (file)

Constant: single-float-positive-infinity

The positive infinity for single-floats.

Supported on:
* ABCL
* ALLEGRO
* CCL
* CMUCL
* ECL
* LISPWORKS
* MEZZANO
* MKCL
* SBCL

Defaults to MOST-POSITIVE-SINGLE-FLOAT on unsupported implementations.

Package

float-features

Source

float-features.lisp (file)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.2 Symbol macros

Symbol Macro: long-float-nan
Package

float-features

Source

nan.lisp (file)

Expansion

(float-features:bits-long-float 170138587312039964317873038467719495680)


Next: , Previous: , Up: Exported definitions   [Contents][Index]

5.1.3 Macros

Macro: with-float-traps-masked TRAPS &body BODY

Attempts to mask the given floating point traps.

Masking a floating point trap causes the given floating point exception to not signal a condition in the lisp world, and instead lets the operation return a float that is either a NaN or an infinity.

The following traps are recognised:

:underflow
:overflow
:inexact
:invalid
:divide-by-zero
:denormalized-operand

The traps argument may be either a list of the above trap identifiers, or T to signify all maskable traps.

Note that not all implementations will signal conditions on all of the above floating point traps anyway, and some implementations may only support masking some of the above traps.

Supported on:
* ABCL (:overflow :underflow)
* CCL (:overflow :underflow :inexact :invalid :divide-by-zero)
* CLISP (:underflow)
* CMUCL T
* ECL (:underflow :overflow :inexact :invalid :divide-by-zero)
* MEZZANO T
* SBCL T

Defaults to a progn on unsupported implementations and ignores unsupported traps.

Package

float-features

Source

float-features.lisp (file)


Previous: , Up: Exported definitions   [Contents][Index]

5.1.4 Functions

Function: bits-double-float BITS

Encodes the (unsigned-byte 64) bit representation into a native double-float.

Supported on:
* ABCL
* ALLEGRO
* CCL
* CLASP
* CMUCL
* LISPWORKS
* MEZZANO
* SBCL

Defaults to signalling an error on unsupported implementations.

Package

float-features

Source

float-features.lisp (file)

Function: bits-long-float BITS

Encodes the (unsigned-byte 128) bit representation into a native long-float.

Supported on:

Defaults to signalling an error on unsupported implementations.

Package

float-features

Source

float-features.lisp (file)

Function: bits-short-float BITS

Encodes the (unsigned-byte 16) bit representation into a native short-float.

Supported on:
* MEZZANO

Supported (with 32bit short-float = single-float) on:
* ALLEGRO
* CCL
* CMUCL
* ECL
* LISPWORKS (64-bit only. on 32-bit lw, short-float is not 16 or 32 bits) * SBCL

Defaults to signalling an error on unsupported implementations.

Package

float-features

Source

float-features.lisp (file)

Function: bits-single-float BITS

Encodes the (unsigned-byte 32) bit representation into a native single-float.

Supported on:
* ABCL
* ALLEGRO
* CCL
* CLASP
* CMUCL
* LISPWORKS
* MEZZANO
* SBCL

Defaults to signalling an error on unsupported implementations.

Package

float-features

Source

float-features.lisp (file)

Function: double-float-bits FLOAT

Returns the bit representation of the double-float as an (unsigned-byte 64).

Supported on:
* ABCL
* ALLEGRO
* CCL
* CLASP
* CMUCL
* LISPWORKS
* MEZZANO
* SBCL

Defaults to signalling an error on unsupported implementations.

Package

float-features

Source

float-features.lisp (file)

Function: float-infinity-p FLOAT

Returns T if the given float is an infinity, NIL otherwise.

Supported on:
* ABCL
* ALLEGRO
* CCL
* CMUCL
* ECL
* LISPWORKS
* MEZZANO
* SBCL

Defaults to comparing against the individual constants on unsupported implementations.

Package

float-features

Source

float-features.lisp (file)

Function: float-nan-p FLOAT

Returns T if the given float is in not-a-number state, NIL otherwise.

Supported on:
* ABCL
* ALLEGRO
* CCL
* CMUCL
* ECL
* LISPWORKS
* MEZZANO
* SBCL

Defaults to returning NIL on unsupported implementations.

Package

float-features

Source

float-features.lisp (file)

Function: long-float-bits FLOAT

Returns the bit representation of the long-float as an (unsigned-byte 128).

Supported on:

Defaults to signalling an error on unsupported implementations.

Package

float-features

Source

float-features.lisp (file)

Function: short-float-bits FLOAT

Returns the bit representation of the short-float as an (unsigned-byte 16).

Supported on:
* MEZZANO

Supported (with 32bit short-float = single-float) on:
* ALLEGRO
* CCL
* CMUCL
* ECL
* LISPWORKS (64-bit only. on 32-bit lw, short-float is not 16 or 32 bits) * SBCL

On platforms with 32-bit short-float, low bits of significand are dropped without rounding, and out of range exponents are converted to infinities. All values returned by bits-short-float should convert
back to the same bits.

Defaults to signalling an error on unsupported implementations.

Package

float-features

Source

float-features.lisp (file)

Function: single-float-bits FLOAT

Returns the bit representation of the single-float as an (unsigned-byte 32).

Supported on:
* ABCL
* ALLEGRO
* CCL
* CLASP
* CMUCL
* LISPWORKS
* MEZZANO
* SBCL

Defaults to signalling an error on unsupported implementations.

Package

float-features

Source

float-features.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Functions

Function: keep LIST &rest KEEPS
Package

float-features

Source

float-features.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   F   L  
Index Entry  Section

F
File, Lisp, float-features.asd: The float-features․asd file
File, Lisp, float-features/documentation.lisp: The float-features/documentation․lisp file
File, Lisp, float-features/float-features.lisp: The float-features/float-features․lisp file
File, Lisp, float-features/nan.lisp: The float-features/nan․lisp file
float-features.asd: The float-features․asd file
float-features/documentation.lisp: The float-features/documentation․lisp file
float-features/float-features.lisp: The float-features/float-features․lisp file
float-features/nan.lisp: The float-features/nan․lisp file

L
Lisp File, float-features.asd: The float-features․asd file
Lisp File, float-features/documentation.lisp: The float-features/documentation․lisp file
Lisp File, float-features/float-features.lisp: The float-features/float-features․lisp file
Lisp File, float-features/nan.lisp: The float-features/nan․lisp file

Jump to:   F   L  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   B   D   F   K   L   M   S   W  
Index Entry  Section

B
bits-double-float: Exported functions
bits-long-float: Exported functions
bits-short-float: Exported functions
bits-single-float: Exported functions

D
double-float-bits: Exported functions

F
float-infinity-p: Exported functions
float-nan-p: Exported functions
Function, bits-double-float: Exported functions
Function, bits-long-float: Exported functions
Function, bits-short-float: Exported functions
Function, bits-single-float: Exported functions
Function, double-float-bits: Exported functions
Function, float-infinity-p: Exported functions
Function, float-nan-p: Exported functions
Function, keep: Internal functions
Function, long-float-bits: Exported functions
Function, short-float-bits: Exported functions
Function, single-float-bits: Exported functions

K
keep: Internal functions

L
long-float-bits: Exported functions

M
Macro, with-float-traps-masked: Exported macros

S
short-float-bits: Exported functions
single-float-bits: Exported functions

W
with-float-traps-masked: Exported macros

Jump to:   B   D   F   K   L   M   S   W  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   C   D   L   S  
Index Entry  Section

C
Constant, double-float-nan: Exported constants
Constant, double-float-negative-infinity: Exported constants
Constant, double-float-positive-infinity: Exported constants
Constant, long-float-negative-infinity: Exported constants
Constant, long-float-positive-infinity: Exported constants
Constant, short-float-nan: Exported constants
Constant, short-float-negative-infinity: Exported constants
Constant, short-float-positive-infinity: Exported constants
Constant, single-float-nan: Exported constants
Constant, single-float-negative-infinity: Exported constants
Constant, single-float-positive-infinity: Exported constants

D
double-float-nan: Exported constants
double-float-negative-infinity: Exported constants
double-float-positive-infinity: Exported constants

L
long-float-nan: Exported symbol macros
long-float-negative-infinity: Exported constants
long-float-positive-infinity: Exported constants

S
short-float-nan: Exported constants
short-float-negative-infinity: Exported constants
short-float-positive-infinity: Exported constants
single-float-nan: Exported constants
single-float-negative-infinity: Exported constants
single-float-positive-infinity: Exported constants
Symbol Macro, long-float-nan: Exported symbol macros

Jump to:   C   D   L   S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   F   P   S  
Index Entry  Section

F
float-features: The float-features system
float-features: The float-features package

P
Package, float-features: The float-features package

S
System, float-features: The float-features system

Jump to:   F   P   S