Next: , Previous: , Up: iklib   [Index]


6.31 Additional functions on flonums

The following bindings are exported by the library (vicare).

Predicates

Function: list-of-flonums? obj

Return #t if obj is null or a proper list of flonums; otherwise return #f.

Function: flnonpositive? fl
Function: flnonnegative? fl

Return #t if fl is, respectively, non–positive or non–negative; else return #f.

Function: zero-flonum? obj
Function: positive-zero-flonum? obj
Function: negative-zero-flonum? obj

Return #t if obj is a flonum representing zero, positive zero or negative zero; otherwise return #f. If obj is not a flonum: return #f.

Function: positive-flonum? obj
Function: negative-flonum? obj
Function: non-positive-flonum? obj
Function: non-negative-flonum? obj

Return #t if obj is a flonum respectively: positive, negative, non–positive, non–negative; otherwise return #f. If obj is not a flonum: return #f.

Notice the following behaviour with zero:

(positive-flonum? +0.0)         ⇒ #f
(positive-flonum? -0.0)         ⇒ #f

(negative-flonum? +0.0)         ⇒ #f
(negative-flonum? -0.0)         ⇒ #f

(non-positive-flonum? +0.0)     ⇒ #t
(non-positive-flonum? -0.0)     ⇒ #t

(non-negative-flonum? +0.0)     ⇒ #t
(non-negative-flonum? -0.0)     ⇒ #t

Comparison

Function: fl!=? fl0 fl

The arguments must be flonums. Return #t if the arguments are all different: no two arguments are equal; otherwise return #f. When applied to a single argument: return #f.

String conversion

Function: flzero?/positive fl
Function: flzero?/negative fl

Return true if the operand is +0.0 or -0.0, respectively. Notice that flzero? does not make this distinction.

String conversion

Function: string->flonum fl
Function: flonum->string str

Convert between a flonum and its string representation.

Exponents and logarithms

Function: fllog1p fl

Return a flonum equivalent to log(1 + fl).

Function: flexpm1 fl

Return a flonum equivalent to exp(fl) - 1.

Function: flhypot fl1 fl2

Compute the Euclidean distance function: \sqrt(X*X+Y*Y). (libc)hypot.

Hyperbolic functions

Function: flsinh fl
Function: flcosh fl
Function: fltanh fl

Compute the hyperbolic functions. Return flonum objects.

Function: flasinh fl
Function: flacosh fl
Function: flatanh fl

Compute the inverse hyperbolic functions. Return flonum objects.

Power functions

Function: flsquare fl

Return the square of fl, that is fl multiplied by itself.

Function: flcube fl

Return the cube of fl, that is fl times fl times fl.

Function: flcbrt fl

Return the real cube root function of fl.

Miscellaneous functions

Function: flonum-bytes fl

Return 8 values being fixnums representing octects from the binary representation of fl.

Function: flonum-parts fl

Return 3 values begin: a boolean, true if fl is positive; a fixnum representing the exponent’s 11 bits; an exact integer representing the mantissa’s 53 bits.

(flonum-parts 2.0)
⇒ #t #b10000000000 #b0

(flonum-parts 4.0)
⇒ #t #b10000000001 #b0

(flonum-parts +0.0)
⇒ #t #b00000000000 #b0

(flonum-parts -0.0)
⇒ #f #b00000000000 #b0

Next: , Previous: , Up: iklib   [Index]