You are looking at historical revision 38109 of this page. It may differ significantly from its current revision.

fx-utils

Documentation

Additional fixnum routines.

Fixnum Computations

Usage

(import fx-utils)

N N1 ... X1 ... Y1 ... below are fixnum.

fxrandom

[procedure] (fxrandom [N]) -> fixnum

N fixnum limit.

fxlog2

[procedure] (fxlog2 N) -> fixnum

Returns index of highest bit set, so N is treated as unsigned.

fxpow2log2

[procedure] (fxpow2log2 N) -> fixnum

Returns fixnum 2^N.

fxdistance

[procedure] (fxdistance X1 Y1 X2 Y2) -> fixnum

Pythagorean distance between the points X1 Y1 and X2 Y2.

fxdistance*

[procedure] (fxdistance* X1 Y1 X2 Y2) -> fixnum

Pythagorean 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) -> boolean

fxpositive?

[procedure] (fxpositive? N) -> boolean

fxcardinal?

[procedure] (fxcardinal? N) -> boolean

fxnegative?

[procedure] (fxnegative? N) -> boolean

fxclosed-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) -> boolean

N, 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) -> fixnum

fxsub1

[procedure] (fxsub1 N) -> fixnum

fxabs

[procedure] (fxabs N) -> fixnum

fxsqr

[procedure] (fxsqr N) -> fixnum

fxcub

[procedure] (fxcub N) -> fixnum

Author

Kon Lovett

Version history

4.0.0
C5 port.

License

This code is in the public domain.