math built in functions. More...
Go to the source code of this file.
Functions | |
static long | c_mult () |
multiplication More... | |
static long | c_div () |
division More... | |
static long | c_intdiv () |
integer division More... | |
static long | c_floor_ceiling (long floorflag) |
floor & ceiling More... | |
static long | c_floor () |
floor More... | |
static long | c_ceiling () |
ceiling More... | |
static long | c_sqrt () |
square root More... | |
static long | c_trig (long trigflag) |
trig functions More... | |
static long | c_cos () |
cosine More... | |
static long | c_sin () |
sin Return the sine of the argument More... | |
static long | c_tan () |
tangent More... | |
static long | c_bit_not () |
bitwise not More... | |
static long | c_bit_and () |
bitwise and More... | |
static long | c_bit_or () |
bitwise or More... | |
static long | c_shift (long dir) |
bitwise shift More... | |
static long | c_shift_left () |
bitwise shift left More... | |
static long | c_shift_right () |
static long | c_mod () |
modulo More... | |
static long | c_add () |
addition More... | |
static long | c_sub () |
subtraction More... | |
static long | c_log () |
natural logarithm More... | |
static long | c_exp () |
exponential More... | |
void | insert_math_builtins () |
insert math builtins into table More... | |
math built in functions.
Definition in file bi_math.c.
|
static |
addition
Addition is considered as a 3-variable relation as in Prolog: arg1 + arg2 = arg3 Only it may residuate or curry. Addition is further complicated by the fact that it is both a unary and binary function.
Definition at line 1016 of file bi_math.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, wl_goal::bbbb_1, curry(), deref, deref_args, deref_ptr, FALSE, get_real_value(), get_two_args(), nonnum_warning(), NULL, push_goal(), REAL, residuate2(), residuate3(), set_1_2, TRUE, unify, and unify_real_result().
|
static |
bitwise and
Return the bitwise operation: ARG1 and ARG2.
Definition at line 703 of file bi_math.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, wl_goal::bbbb_1, bit_and_warning(), curry(), deref, deref_args, deref_ptr, FALSE, get_real_value(), get_two_args(), nonnum_warning(), REAL, residuate(), residuate2(), set_1_2, TRUE, and unify_real_result().
|
static |
bitwise not
Return the bitwise not of the argument
Definition at line 649 of file bi_math.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, wl_goal::bbbb_1, bit_not_warning(), curry(), deref, deref_args, deref_ptr, FALSE, get_one_arg(), get_real_value(), nonnum_warning(), NULL, REAL, residuate2(), set_1, TRUE, and unify_real_result().
|
static |
bitwise or
Return the bitwise operation: ARG1 or ARG2.
Definition at line 785 of file bi_math.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, wl_goal::bbbb_1, bit_or_warning(), curry(), deref, deref_args, deref_ptr, FALSE, get_real_value(), get_two_args(), nonnum_warning(), REAL, residuate(), residuate2(), set_1_2, TRUE, and unify_real_result().
|
static |
ceiling
Return the smallest integer larger or equal to the argument
Definition at line 490 of file bi_math.c.
References c_floor_ceiling(), and FALSE.
|
static |
|
static |
division
Division is considered as a 3-variable relation as in Prolog: arg1 / arg2 = arg3 Only it may residuate or curry.
Definition at line 138 of file bi_math.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, wl_goal::bbbb_1, curry(), deref, deref_args, deref_ptr, Errorline(), FALSE, get_real_value(), get_two_args(), nonnum_warning(), NULL, push_goal(), REAL, residuate(), residuate2(), residuate3(), set_1_2, TRUE, unify, and unify_real_result().
|
static |
exponential
Exponential.
Definition at line 1295 of file bi_math.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, wl_goal::bbbb_1, curry(), deref, deref_args, deref_ptr, FALSE, get_real_value(), get_two_args(), nonnum_warning(), NULL, REAL, residuate2(), set_1, TRUE, and unify_real_result().
|
static |
floor
Return the largest integer inferior or equal to the argument
Definition at line 479 of file bi_math.c.
References c_floor_ceiling(), and TRUE.
|
static |
floor & ceiling
floorflag | TRUE for floor - FALSE for ceiling |
Main routine for floor & ceiling functions
Definition at line 431 of file bi_math.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, wl_goal::bbbb_1, curry(), deref, deref_args, deref_ptr, get_real_value(), get_two_args(), nonnum_warning(), NULL, REAL, residuate(), set_1, TRUE, and unify_real_result().
|
static |
integer division
Similar to division, but arguments and result must be integers. Does all deterministic local inversions that can be determined in constant-time independent of argument values.
Definition at line 264 of file bi_math.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, wl_goal::bbbb_1, curry(), deref, deref_args, deref_ptr, Errorline(), FALSE, get_real_value(), get_two_args(), int_div_warning(), nonnum_warning(), NULL, push_goal(), REAL, residuate(), residuate2(), residuate3(), set_1_2, TRUE, unify, and unify_real_result().
|
static |
natural logarithm
Natural logarithm.
Definition at line 1238 of file bi_math.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, wl_goal::bbbb_1, curry(), deref, deref_args, deref_ptr, Errorline(), FALSE, get_one_arg(), get_real_value(), nonnum_warning(), NULL, REAL, residuate2(), set_1, TRUE, and unify_real_result().
|
static |
modulo
The modulo operation.
Definition at line 945 of file bi_math.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, wl_goal::bbbb_1, curry(), deref, deref_args, deref_ptr, FALSE, get_real_value(), get_two_args(), mod_warning(), nonnum_warning(), REAL, residuate(), residuate2(), set_1_2, TRUE, and unify_real_result().
|
static |
multiplication
Multiplication is considered as a 3-variable relation as in Prolog: arg1 * arg2 = arg3 Only it may residuate or curry.
Definition at line 28 of file bi_math.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, wl_goal::bbbb_1, curry(), deref, deref_args, deref_ptr, FALSE, get_real_value(), get_two_args(), nonnum_warning(), NULL, push_goal(), REAL, residuate(), residuate2(), residuate3(), set_1_2, TRUE, unify, and unify_real_result().
|
static |
bitwise shift
dir | FALSE = left TRUE = right |
Return the bitwise shift dir.
Definition at line 876 of file bi_math.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, wl_goal::bbbb_1, curry(), deref, deref_args, deref_ptr, FALSE, get_real_value(), get_two_args(), nonnum_warning(), REAL, residuate(), residuate2(), set_1_2, shift_warning(), TRUE, and unify_real_result().
|
static |
|
static |
|
static |
|
static |
square root
c_sqrt() Return the square root of the argument
Definition at line 501 of file bi_math.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, wl_goal::bbbb_1, curry(), deref, deref_args, deref_ptr, Errorline(), FALSE, get_one_arg(), get_real_value(), nonnum_warning(), NULL, REAL, residuate2(), set_1, TRUE, and unify_real_result().
|
static |
subtraction
Subrtaction is considered as a 3-variable relation as in Prolog: arg1 - arg2 = arg3 Only it may residuate or curry. Subtraction is further complicated by the fact that it is both a unary and binary function.
Definition at line 1132 of file bi_math.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, wl_goal::bbbb_1, curry(), deref, deref_args, deref_ptr, FALSE, get_real_value(), get_two_args(), nonnum_warning(), NULL, push_goal(), REAL, residuate2(), residuate3(), set_1_2, TRUE, unify, and unify_real_result().
|
static |
|
static |
trig functions
trigflag | SINFLAG, COSFLAG or TANFLAG |
Main routine for sine and cosine
Definition at line 556 of file bi_math.c.
References wl_goal::aaaa_1, aim, wl_psi_term::attr_list, wl_goal::bbbb_1, COSFLAG, curry(), deref, deref_args, deref_ptr, FALSE, get_one_arg(), get_real_value(), nonnum_warning(), NULL, REAL, residuate2(), set_1, SINFLAG, TANFLAG, TRUE, and unify_real_result().
insert_math_builtins | ( | ) |
insert math builtins into table
insert functions into table
Definition at line 1346 of file bi_math.c.
References bi_module, c_add(), c_bit_and(), c_bit_not(), c_bit_or(), c_ceiling(), c_cos(), c_div(), c_exp(), c_floor(), c_intdiv(), c_log(), c_mod(), c_mult(), c_shift_left(), c_shift_right(), c_sin(), c_sqrt(), c_sub(), c_tan(), function_it, new_built_in(), and syntax_module.