Trees | Indices | Help |
---|
|
This provides useful general math tools.
Functions: fcmp Compare two floating point numbers, up to a specified precision. intd Represent a floating point number as an integer. safe_log log, but returns an arbitrarily small number for log(0). safe_exp exp, but returns a large or small number instead of overflows.
|
|||
-1, 0, or 1 |
|
||
int x, rounded |
|
||
log(n) |
|
||
log(n) |
|
||
e**n |
|
|
|||
LOG2 = 0.69314718056
|
|
Represent a floating point number with some digits after the decimal point as an integer. This is useful when floating point comparisons are failing due to precision problems. e.g. intd(5.35, 1) -> 54.
|
Calculate the log of n. If n is 0, returns the value of zero. If n is negative, returns the value of neg.
|
Calculate the log base 2 of n. If n is 0, returns the value of zero. If n is negative, returns the value of neg.
|
Guaranteed not to overflow. Instead of overflowing, it returns the values of 'under' for underflows or 'over' for overflows.
|
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Mon Sep 15 09:22:40 2008 | http://epydoc.sourceforge.net |