Next: syslib bignums, Previous: syslib keywords, Up: syslib [Index]
The following bindings are exported by the library (vicare
system $fx)
. The arguments to these operations must be fixnums.
objects fixnums for details on the representation of fixnums.
Evaluate to true if fx is zero.
Evaluate to true if fx is strictly positive or strictly negative.
Evaluate to true if fx is non–positive or non–negative.
Return one of the fixnums +1
, -1
, 0
representing
the sign of fx.
Evaluate to true if fx is even or odd.
Evaluate to true if the arguments are equal.
Evaluate to true if the arguments are different.
Evaluate to true if fx1 is less than fx2.
Evaluate to true if fx1 is less than or equal to fx2.
Evaluate to true if fx1 is greater than fx2.
Evaluate to true if fx1 is greater than or equal to fx2.
Return either the maximum or minimum between the arguments.
Increment the operand by one and return the result.
Decrement the operand by one and return the result. The result of this
operation is a fixnum, but notice that if fx is
(least-fixnum)
: the result overflows the fixnum capacity and the
return value is invalid.
Sum the operands and return the result. The result of this operatio is a fixnum, but notice that it could overflow the fixnum capacity.
With one operand: return fx negated. With two operands: subtract the operands and return the result. The result of this operation is a fixnum, but notice that it could overflow the fixnum capacity and the return value would be invalid.
Also with a single argument, knowing that (- (least-fixnum))
is a
bignum, if fx is (least-fixnum)
the result overflows the
fixnum capacity and the return value is invalid.
With two arguments: if fx1 is zero and fx2 is
(least-fixnum)
the result overflows the fixnum capacity and the
return value is invalid.
Multiply the operands and return the result. The result of this
operation is a fixnum, but notice that if one operand is -1
and
the other is (least-fixnum)
: the result overflows the fixnum
capacity and the return value is invalid.
Perform the number theoretic division.
(import (rnrs) (vicare system $fx)) ($fxmod +12 +12) ⇒ 0 ($fxmod +12 -12) ⇒ 0 ($fxmod -12 +12) ⇒ 0 ($fxmod -12 -12) ⇒ 0 ($fxmod +12 +3) ⇒ 0 ($fxmod +12 -3) ⇒ 0 ($fxmod -12 +3) ⇒ 0 ($fxmod -12 -3) ⇒ 0 ($fxmod +12 +4) ⇒ 0 ($fxmod +12 -4) ⇒ 0 ($fxmod -12 +4) ⇒ 0 ($fxmod -12 -4) ⇒ 0 ($fxmod +12 +5) ⇒ +2 ($fxmod +12 -5) ⇒ +2 ($fxmod -12 +5) ⇒ +3 ($fxmod -12 -5) ⇒ +3 ($fxmod +12 +7) ⇒ +5 ($fxmod +12 -7) ⇒ +5 ($fxmod -12 +7) ⇒ +2 ($fxmod -12 -7) ⇒ +2 ($fxmod +12 +24) ⇒ +12 ($fxmod +12 -24) ⇒ +12 ($fxmod -12 +24) ⇒ +12 ($fxmod -12 -24) ⇒ +12 ($fxmod +12 +20) ⇒ +12 ($fxmod +12 -20) ⇒ +12 ($fxmod -12 +20) ⇒ +8 ($fxmod -12 -20) ⇒ +8
Compute the quotient between the operands and return the result. The result of this operation is a fixnum, but notice that:
0
: the result is undefined, most likely the
process will abort.
(least-fixnum)
and fx2 is -1
: the
result will overflow the fixnum capacity, and the return value will be
invalid (the result should be a bignum).
Compute the modulo between the operands and return the result. The result of this operation can be a fixnum or bignum.
(import (rnrs) (vicare system $fx)) ($fxmodulo +12 +12) ⇒ 0 ($fxmodulo +12 -12) ⇒ 0 ($fxmodulo -12 +12) ⇒ 0 ($fxmodulo -12 -12) ⇒ 0 ($fxmodulo +12 +3) ⇒ 0 ($fxmodulo +12 -3) ⇒ 0 ($fxmodulo -12 +3) ⇒ 0 ($fxmodulo -12 -3) ⇒ 0 ($fxmodulo +12 +4) ⇒ 0 ($fxmodulo +12 -4) ⇒ 0 ($fxmodulo -12 +4) ⇒ 0 ($fxmodulo -12 -4) ⇒ 0 ($fxmodulo +12 +5) ⇒ +2 ($fxmodulo +12 -5) ⇒ -3 ($fxmodulo -12 +5) ⇒ +3 ($fxmodulo -12 -5) ⇒ -2 ($fxmodulo +12 +7) ⇒ +5 ($fxmodulo +12 -7) ⇒ -2 ($fxmodulo -12 +7) ⇒ +2 ($fxmodulo -12 -7) ⇒ -5 ($fxmodulo +12 +24) ⇒ +12 ($fxmodulo +12 -24) ⇒ -12 ($fxmodulo -12 +24) ⇒ +12 ($fxmodulo -12 -24) ⇒ -12 ($fxmodulo +12 +20) ⇒ +12 ($fxmodulo +12 -20) ⇒ -8 ($fxmodulo -12 +20) ⇒ +8 ($fxmodulo -12 -20) ⇒ -12
Return the absolute value of fx as a fixnum. When fx is
(least-fixnum)
: its absolute value would be a fixnum, in which
case this operation raises an implementation restriction violation.
To compute the general absolute value without overflow we must use
abs
or $abs-fixnum
.
Perform the bitwise NOT on the operand and return the result.
Perform the bitwise AND on the operands and return the result.
Perform the bitwise inclusive OR on the operands and return the result.
Perform the bitwise exclusive OR on the operands and return the result.
Return the fixnum that is the bit–wise “if” of the two’s complement representations of its arguments, i.e. for each bit, if it is 1 in fx1, the corresponding bit in fx2 becomes the value of the corresponding bit in the result, and if it is 0, the corresponding bit in fx3 becomes the corresponding bit in the value of the result.
Perform bitwise shift left of fx1 by fx2 positions and return the result.
Perform bitwise shift right of fx1 by fx2 positions and return the result.
Unsafe version of fxcopy-bit
.
Unsafe version of fxcopy-bit-field
.
Unsafe version of fxrotate-bit-field
.
Unsafe version of fxbit-field
.
Return a string object representing fx in base. base must be one among: 2, 8, 10, 16.
Return a new character value whose code point equals fx.
Return a fixnum representing the code point of the operand.
Convert the fixnum operand into a flonum and return a reference to the result.
Evaluate to a fixnum which can be used as hash value.
NOTE This appears to be unused in the source.
Next: syslib bignums, Previous: syslib keywords, Up: syslib [Index]