Next: , Previous: , Up: API Reference   [Contents][Index]


3.10 Floats

Grip procedures and variables to process floats. The module is loaded by entering the following:

(use-modules (grip float))

Note that some of the procedures provided by this module (float-zero?, float=? …) are based on their corresponding ‘quasi’ homonyms provided by ((rnrs arithmetic flonums) :version (6)) (just a question of ‘naming’ convention preferences … Grip should bind and document all others in the future).

Procedures

float-zero?
float=?
float<?
float<=?
float>?
float>=?
float-round
float-member

Procedures

Procedure: float-zero? f

Returns #t if f is zero. Otherwise, it returns #f.

Procedure: float=? f1 f2 f3 …
Procedure: float<? f1 f2 f3 …
Procedure: float<=? f1 f2 f3 …
Procedure: float>? f1 f2 f3 …
Procedure: float>=? f1 f2 f3 …

These procedures return #t if f1 f2 f3 … are (respectively) equal, monotonically increasing, monotonically nondecreasing, monotonically decreasing, or monotonically nonincreasing. Otherwise, it returns #f.

Procedure: float-round f [n-dec 2]

Returns the n-dec rounded float for f.

Procedure: float-member f vals

Returns the indice of the position of f in vals if it is found (using float=?). Otherwise it returns #f.