#include "muse_builtin_math.h"#include <math.h>#include <stdlib.h>Include dependency graph for muse_builtin_math.c:

Defines | |
| #define | muse_floor floor |
| #define | muse_ceil ceil |
Typedefs | |
| typedef double(*) | unary_math_op_t (double) |
| The type unary math operators. | |
Functions | |
| muse_cell | fn_add (muse_env *env, void *context, muse_cell args) |
| (+ <numbers>). | |
| muse_cell | fn_sub (muse_env *env, void *context, muse_cell args) |
| (- <numbers>). | |
| muse_cell | fn_mul (muse_env *env, void *context, muse_cell args) |
| (* <numbers>). | |
| muse_cell | fn_div (muse_env *env, void *context, muse_cell args) |
| (/ <numbers>). | |
| muse_cell | fn_idiv (muse_env *env, void *context, muse_cell args) |
| (i/ numerator denominator). | |
| muse_cell | fn_mod (muse_env *env, void *context, muse_cell args) |
| (% numerator denominator). | |
| muse_cell | fn_inc (muse_env *env, void *context, muse_cell args) |
| (++ c). | |
| muse_cell | fn_dec (muse_env *env, void *context, muse_cell args) |
| (-- c). | |
| muse_cell | fn_trunc (muse_env *env, void *context, muse_cell args) |
| (trunc float-value). | |
| muse_cell | fn_rand (muse_env *env, void *context, muse_cell args) |
| (rand M [N]). | |
| muse_cell | fn_pow (muse_env *env, void *context, muse_cell args) |
| (pow base exponent). | |
| muse_cell | fn_unary_math (muse_env *env, void *fn, muse_cell args) |
| The function that calls the supplied unary math operator in the "context" field on the given argument. | |
| void | muse_math_load_common_unary_functions () |
| Defines log, log10, sqrt, sin, cos, tan, etc. | |
All rights reserved. See LICENSE.txt distributed with this source code or http://muvee-symbolic-expressions.googlecode.com/svn/trunk/LICENSE.txt for terms and conditions under which this software is provided to you.
| #define muse_floor floor |
| #define muse_ceil ceil |
| typedef double(*) unary_math_op_t(double) |
The type unary math operators.
(+ <numbers>).
add sums up all of its arguments and returns the result. The result will be an integer if all of its arguments are integers. Otherwise it'll be float.
(- <numbers>).
Takes 1 or more arguments.
(- m) gives -m(- m n) gives (m-n)(- m n o p) gives (m - (n+o+p)) (* <numbers>).
Multiplies all arguments. Result is float if at least one of the arguments is float. Otherwise it is an integer.
(/ <numbers>).
Takes 1 or more arguments.
(/ m) gives 1/m(/ m n) gives (m/n)(/ m n o p) gives (m / (n * o * p)) (i/ numerator denominator).
Takes 2 arguments. Divides first by the second and returns the quotient. Arguments must be integers.
(% numerator denominator).
Takes 2 arguments and returns the floating point or integer remainder on dividing first by the second.
(++ c).
Increments the integer contents of the given cell.
(-- c).
Decrements the integer contents of the given cell.
(trunc float-value).
Converts a float to int. If given an integer argument. returns it as is.
(rand M [N]).
Generates a random number.
(rand N) returns an integer random number in the range [0,N)(rand M N) returns an integer random number in the range [M,N)(rand F) returns a float random number in the range [0,F).(rand G F) returns a float random number in the range [G,F). (pow base exponent).
Computes base ^ exponent. The result is always a float.
The function that calls the supplied unary math operator in the "context" field on the given argument.
The supported unary math operations are -
| void muse_math_load_common_unary_functions | ( | ) |
Defines log, log10, sqrt, sin, cos, tan, etc.
1.4.7