Next: iklib fixnums conversion, Previous: iklib fixnums comparison, Up: iklib fixnums [Index]
Add or subtract ‘1’ to fx.
Return the absolute value of the fixnum fx as a fixnum; if
fx is (least-fixnum)
: its absolute value is a bignum, in
which case this function raises an implementation restriction violation.
To compute the general absolute value without overflow we must use
abs
or $abs-fixnum
.
Return one of the fixnums +1
, -1
, 0
representing
the sign of the fixnum fx.
These procedures implement number–theoretic (integer) division on fixnum arguments. fx2 must be non–zero. All three procedures return fixnum objects. If fx1/fx2 is an integer object:
(fxquotient fx1 fx2) ⇒ fx1/fx2 (fxremainder fx1 fx2) ⇒ 0 (fxmodulo fx1 fx2) ⇒ 0
If fx1/fx2 is not an integer object:
(fxquotient fx1 fx2) ⇒ n_q (fxremainder fx1 fx2) ⇒ n_r (fxmodulo fx1 fx2) ⇒ n_m
where n_q is fx1/fx2 rounded towards zero,
0 < |n_r| < |fx2| 0 < |n_m| < |fx2|
n_r and n_m differ from fx1 by a multiple of fx2, n_r has the same sign as fx1, and n_m has the same sign as fx2.
Consequently, for integer objects fx1 and fx2 with fx2 not equal to 0,
(= fx1 (+ (* fx2 (fxquotient fx1 fx2)) (fxremainder fx1 fx2))) ⇒ #t
provided all number object involved in that computation are exact.
(fxmodulo 13 4) ⇒ 1 (fxremainder 13 4) ⇒ 1 (fxmodulo -13 4) ⇒ 3 (fxremainder -13 4) ⇒ -1 (fxmodulo 13 -4) ⇒ -3 (fxremainder 13 -4) ⇒ 1 (fxmodulo -13 -4) ⇒ -1 (fxremainder -13 -4) ⇒ -1
Next: iklib fixnums conversion, Previous: iklib fixnums comparison, Up: iklib fixnums [Index]