fx-utils
Documentation
Additional fixnum routines.
Fixnum Computations
Usage
(import fx-utils)N N1 ... X1 ... Y1 ... below are fixnum.
fxrandom
(fxrandom [N]) -> fixnumN fixnum limit.
fxlog2
(fxlog2 N) -> fixnumReturns index of highest bit set, so N is treated as unsigned.
fxpow2log2
(fxpow2log2 N) -> fixnumReturns fixnum 2^N.
fxdistance
(fxdistance X1 Y1 X2 Y2) -> fixnumPythagorean distance between the points X1 Y1 and X2 Y2.
fxdistance*
(fxdistance* X1 Y1 X2 Y2) -> fixnumPythagorean distance, inaccurate but useful for relative comparisons.
fxquo-and-mod
(fxquo-and-mod N D) -> (values fixnum fixnum)Returns the quotient & remainder values for fixnums D & D.
fxmax-and-min
(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?
(fxzero? N) -> booleanfxpositive?
(fxpositive? N) -> booleanfxcardinal?
(fxcardinal? N) -> booleanfxnegative?
(fxnegative? N) -> booleanfxclosed-right?
fxclosedr?
Returns N in (L .. H].
N, L & H are fixnum low & high limits.
fxclosed?
Returns N in [L .. H].
(fxclosed? L N H) -> booleanN, L & H are fixnum low & high limits.
fxclosed-left?
fxclosedl?
Returns N in [L .. H).
N, L & H are fixnum low & high limits.
fxadd1
(fxadd1 N) -> fixnumfxsub1
(fxsub1 N) -> fixnumfxabs
(fxabs N) -> fixnumfxsqr
(fxsqr N) -> fixnumfxcub
(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
- 5.0.0
- C6 port.
License
This code is in the public domain.