Module mathfns
source code
This provides useful general math tools (OBSOLETE).
This module and its C code equivalent are considered to be obsolete,
and are likely to be deprecated in a future release of Biopython, before
being removed. Please get in touch via the mailing list if this will
affect you.
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
|
intd(x,
digits_after_decimal=...)
Represent a floating point number with some digits after the decimal
point as an integer. |
source code
|
|
log(n)
|
|
log(n)
|
|
e**n
|
|
|
LOG2 = 0.69314718056
|
|
__package__ = ' Bio '
|
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.
- Returns: int x, rounded
|
Calculate the log of n. If n is 0, returns the value of zero. If n
is negative, returns the value of neg.
- Returns: log(n)
|
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.
- Returns: log(n)
|
Guaranteed not to overflow. Instead of overflowing, it returns the
values of 'under' for underflows or 'over' for overflows.
- Returns: e**n
|