fx-utils
Documentation
Additional fixnum routines.
Fixnum Computations
Usage
(import fx-utils)
N N1 ... X1 ... Y1 ... below are fixnum.
fxrandom
[procedure] (fxrandom [N]) -> fixnumN fixnum limit.
fxlog2
[procedure] (fxlog2 N) -> fixnumReturns index of highest bit set, so N is treated as unsigned.
fxpow2log2
[procedure] (fxpow2log2 N) -> fixnumReturns fixnum 2^N.
fxdistance
[procedure] (fxdistance X1 Y1 X2 Y2) -> fixnumPythagorean distance between the points X1 Y1 and X2 Y2.
fxdistance*
[procedure] (fxdistance* X1 Y1 X2 Y2) -> fixnumPythagorean distance, inaccurate but useful for relative comparisons.
fxquo-and-mod
[procedure] (fxquo-and-mod N D) -> (values fixnum fixnum)Returns the quotient & remainder values for fixnums D & D.
fxmax-and-min
[procedure] (fxmax-and-min N ...) -> (values fixnum fixnum)Returns the maximum & minimum values for the fixnums N ....
Fixnum Inlines
Usage
(import fx-inlines)
N N1 ... X1 ... Y1 ... below are fixnum.
fxzero?
[procedure] (fxzero? N) -> booleanfxpositive?
[procedure] (fxpositive? N) -> booleanfxcardinal?
[procedure] (fxcardinal? N) -> booleanfxnegative?
[procedure] (fxnegative? N) -> booleanfxclosed-right?
fxclosedr?
[procedure] (fxclosed-right? L N H) -> boolean[procedure] (fxclosedr? L N H) -> boolean
Returns N in (L .. H].
N, L & H are fixnum low & high limits.
fxclosed?
Returns N in [L .. H].
[procedure] (fxclosed? L N H) -> booleanN, L & H are fixnum low & high limits.
fxclosed-left?
fxclosedl?
Returns N in [L .. H).
[procedure] (fxclosed-left? L N H) -> boolean[procedure] (fxclosedl? L N H) -> boolean
N, L & H are fixnum low & high limits.
fxadd1
[procedure] (fxadd1 N) -> fixnumfxsub1
[procedure] (fxsub1 N) -> fixnumfxabs
[procedure] (fxabs N) -> fixnumfxsqr
[procedure] (fxsqr N) -> fixnumfxcub
[procedure] (fxcub N) -> fixnumAuthor
Repository
This egg is hosted on the CHICKEN Subversion repository:
https://anonymous@code.call-cc.org/svn/chicken-eggs/release/5/fx-utils
If you want to check out the source code repository of this egg and you are not familiar with Subversion, see this page.
Version history
- 4.0.0
- C5 port.
License
This code is in the public domain.