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


6.32.3 Additional numeric predicates

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

Function: bignum? obj

Return #t if obj is an exact integer represented by a big number; otherwise return #f.

Function: ratnum? obj

Return #t if obj is an exact rational number; otherwise return #f.

Function: cflonum? obj

Return #t if obj is a complex number having flonums as both real and imaginary parts; otherwise return #f.

Function: compnum? obj

Return #t if obj is a complex number having any possible combination of number representations as real and imaginary parts, but not both flonums; otherwise return #f.

Function: exact-integer? obj

Return #t if obj is a fixnum or bignum; otherwise return #f.

Function: exact-compnum? obj

Return #t if obj is a compnum having exact real and imaginary parts; otherwise return #f.

Function: inexact-compnum? obj

Return #t if obj is a compnum having inexact real or imaginary parts; otherwise return #f.

Function: zero-compnum? obj

Return #t if obj is a compnum having both real and imaginary parts equal to zero; otherwise return #f.

Remembering that a compnum with exact zero as imaginary part is converted to a real number by make-rectangular:

1+0i                    ⇒ 1
(make-rectangular 1 0)  ⇒ 1

the compnums of type <zero-compnum> are the following:

   0+0.0i    0-0.0i
+0.0+0.0i -0.0+0.0i
+0.0-0.0i -0.0-0.0i

with the imaginary part always inexact.

Function: non-zero-compnum? obj

Return #t if obj is a compnum having either the real part or imaginary part different from zero; otherwise return #f.

Function: non-zero-inexact-compnum? obj

Return #t if obj is a compnum having: either the real part or imaginary part inexact; either the real part or imaginary part different from zero. Otherwise return #f.

Function: zero-cflonum? obj

Return #t if obj is a cflonum having both real and imaginary parts equal to zero; otherwise return #f.

Function: non-zero-cflonum? obj

Return #t if obj is a cflonum having either the real part or imaginary part different from zero; otherwise return #f.

Function: non-positive? X
Function: non-negative? X

Return #t if X is a real number object and it is, respectively, non–positive or non–negative.

Function: zero-exact-integer? obj

Return #t if obj is an exact integer whose value is zero, otherwise return #f; only fixnums can be zero. If obj is not a number object: return #f.

Function: positive-exact-integer? obj
Function: negative-exact-integer? obj

Return #t if obj is a positive or negative exact integer; otherwise return #f. If obj is not a number object: return #f.

Function: non-positive-exact-integer? obj
Function: non-negative-exact-integer? obj

Return #t if obj is a non–positive or non–negative exact integer; otherwise return #f. If obj is not a number object: return #f.


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