Integer functions
Factor handbook » The language » Numbers » Mathematical functions

Next:Arithmetic functions


align ( m w -- n )

gcd ( x y -- a d )

log2 ( x -- n )

next-power-of-2 ( m -- n )


Modular exponentiation:
^mod ( x y n -- z )

mod-inv ( x n -- y )


Tests:
power-of-2? ( n -- ? )

even? ( n -- ? )

odd? ( n -- ? )

divisor? ( m n -- ? )


Function variants:
integer-log2 ( x -- n )

integer-log10 ( x -- n )

integer-sqrt ( x -- n )