fx***


fxadd(fx1, @rest ...)
fxsub(fx1, @rest ...) 
fxmult(fx1, @rest ...) 
fxdiv(fx1, fx2) 
fxmod(fx1, fx2) 
fxadd_wrap(fx1, @rest ...) 
fxsub_wrap(fx1, @rest ...) 
fxmult_wrap(fx1, @rest ...)
      

Return the result of performing the arithmetic operation on fx1, ... (or fx1 and fx2).

When an ordinary fixnum addition, subtraction, or multiplication operation overflows, an exception is raised. The functions with the _wrap suffix instead return a wrapped-around result.

Examples:


fxadd(12, 34)
// 46

fxsub(greatest_fixnum(), 2)
// 2305843009213693949

fxadd(greatest_fixnum(), 2)
//> error: FIXNUM overflow

fxadd_wrap(greatest_fixnum(), 2)
// -2305843009213693951

fxdiv(10, 3)
// 3
fxmod(10, 3)
// 1
      

Also see:

is_fixnum
fx_is_eq
fxand


Core Module Index | Contents