MathCore

By Andreb Owen
Released under the MIT license

Notes:

Basic math stuff.

+ ( a b -- c ) addition

The addition @operator

- ( a b -- c )

The subtraction @operator

* ( a b -- c )

The multiplication @operator

/ ( a b -- c )

The division @operator

mod ( a b -- c )

Computes a mod b, only for integers

< ( a b -- c ) numeric less than

Numeric less-than. Coerces to doubles if needed.

zero? ( a -- isZero? )

Returns true if a is zero.

min ( a b -- smaller )

max ( a b -- larger )

even? ( n -- ? )

divisor? ( n m -- ? )

= ( a b -- ? )

>= ( a b -- ? )

<= ( a b -- ? )

> ( a b -- ? )

abs ( a -- a )

>double ( d? -- d! )

Either converts the number to a double, or throws an error

acos ( x -- 'x )

Wrapper for Go implementation of acos

acosh ( x -- 'x )

Wrapper for Go implementation of acosh

asin ( x -- 'x )

Wrapper for Go implementation of asin

asinh ( x -- 'x )

Wrapper for Go implementation of asinh

atan ( x -- 'x )

Wrapper for Go implementation of atan

atanh ( x -- 'x )

Wrapper for Go implementation of atanh

cbrt ( x -- 'x )

Wrapper for Go implementation of cbrt

ceil ( x -- 'x )

Wrapper for Go implementation of ceil

cos ( x -- 'x )

Wrapper for Go implementation of cos

cosh ( x -- 'x )

Wrapper for Go implementation of cosh

erf ( x -- 'x )

Wrapper for Go implementation of erf

erfc ( x -- 'x )

Wrapper for Go implementation of erfc

exp ( x -- 'x )

Wrapper for Go implementation of exp

exp2 ( x -- 'x )

Wrapper for Go implementation of exp2

expm1 ( x -- 'x )

Wrapper for Go implementation of expm1

floor ( x -- 'x )

Wrapper for Go implementation of floor

gamma ( x -- 'x )

Wrapper for Go implementation of gamma

j0 ( x -- 'x )

Wrapper for Go implementation of j0

j1 ( x -- 'x )

Wrapper for Go implementation of j1

log ( x -- 'x )

Wrapper for Go implementation of log

log10 ( x -- 'x )

Wrapper for Go implementation of log10

log1p ( x -- 'x )

Wrapper for Go implementation of log1p

log2 ( x -- 'x )

Wrapper for Go implementation of log2

logb ( x -- 'x )

Wrapper for Go implementation of logb

sin ( x -- 'x )

Wrapper for Go implementation of sin

sinh ( x -- 'x )

Wrapper for Go implementation of sinh

sqrt ( x -- 'x )

Wrapper for Go implementation of sqrt

tan ( x -- 'x )

Wrapper for Go implementation of tan

tanh ( x -- 'x )

Wrapper for Go implementation of tanh

trunc ( x -- 'x )

Wrapper for Go implementation of trunc

y0 ( x -- 'x )

Wrapper for Go implementation of y0

y1 ( x -- 'x )

Wrapper for Go implementation of y1