ForthVM.Words.Math (ForthVM v0.5.0) View Source

Math words

Link to this section Summary

Functions

/: ( x y -- n ) divides x by y

max: ( x y -- n ) miaximum between two values

min: ( x y -- n ) minimum between two values

-: ( y x -- n ) subtracts y from x

/mod: ( x y -- rem div ) divides x by y, places divident and reminder on top of data stack

*: ( x y -- n ) multiplies x by y

*/: ( x -- n ) perform multiplication and divide result by x

pi: ( -- n ) puts Pi value on top of stack

**: ( x y -- n ) calculates pow of x by y

rand: ( -- n ) puts random number on stack

Link to this section Functions

Link to this function

abs(tokens, list, return_stack, dictionary, meta)

View Source

abs: ( x -- n ) absolute of x

Link to this function

cos(tokens, list, return_stack, dictionary, meta)

View Source

cos: ( x -- n ) cos of x

Link to this function

div(tokens, list, return_stack, dictionary, meta)

View Source

/: ( x y -- n ) divides x by y

Link to this function

max(tokens, list, return_stack, dictionary, meta)

View Source

max: ( x y -- n ) miaximum between two values

Link to this function

min(tokens, list, return_stack, dictionary, meta)

View Source

min: ( x y -- n ) minimum between two values

Link to this function

minus(tokens, list, return_stack, dictionary, meta)

View Source

-: ( y x -- n ) subtracts y from x

Link to this function

mod(tokens, list, return_stack, dictionary, meta)

View Source

/mod: ( x y -- rem div ) divides x by y, places divident and reminder on top of data stack

Link to this function

mult(tokens, list, return_stack, dictionary, meta)

View Source

*: ( x y -- n ) multiplies x by y

Link to this function

mult_div(tokens, list, return_stack, dictionary, meta)

View Source

*/: ( x -- n ) perform multiplication and divide result by x

Link to this function

negate(tokens, list, return_stack, dictionary, meta)

View Source

@-: ( x -- n ) negates x

Link to this function

one_minus(tokens, list, return_stack, dictionary, meta)

View Source

1-: ( x -- n ) subtracts 1 to x

Link to this function

one_plus(tokens, list, return_stack, dictionary, meta)

View Source

1+: ( x -- n ) adds 1 to x

Link to this function

pi(tokens, data_stack, return_stack, dictionary, meta)

View Source

pi: ( -- n ) puts Pi value on top of stack

Link to this function

plus(tokens, list, return_stack, dictionary, meta)

View Source

+: ( y x -- n ) sums y to x

Link to this function

pow(tokens, list, return_stack, dictionary, meta)

View Source

**: ( x y -- n ) calculates pow of x by y

Link to this function

rand(tokens, data_stack, return_stack, dictionary, meta)

View Source

rand: ( -- n ) puts random number on stack

Link to this function

sin(tokens, list, return_stack, dictionary, meta)

View Source

sin: ( x -- n ) sin of x

Link to this function

sqrt(tokens, list, return_stack, dictionary, meta)

View Source

sqrt: ( x -- n ) sqrt of x

Link to this function

tan(tokens, list, return_stack, dictionary, meta)

View Source

tan: ( x -- n ) tan of x