Basic constants, definitions and functions.
bool
|
isinf(x)
Check if float x is infinite (positive or negative). |
|
|
bool
|
isnan(x)
Check if float x is not a number (NaN). |
|
|
|
clips(bstr,
limit=50,
white='
' )
Clip a string to the given length limit. |
|
|
|
halfs2(str2)
Split a string in 2 halfs. |
|
|
|
InvalidError(Error=<type 'exceptions.ValueError'>,
txt=' invalid ' ,
**name_value_s)
Create a ValueError for invalid name=value
pairs. |
|
|
|
isfinite(obj)
Check for Inf and NaN values. |
|
|
|
isint(obj,
both=False)
Check for int type or an integer float
value. |
|
|
|
|
|
IsnotError(*noun_s,
**name_value_Error)
Create a TypeError for an invalid
name=value type. |
|
|
|
|
|
issequence(obj,
*excluded)
Check for sequence types. |
|
|
|
isstr(obj)
Check for string types. |
|
|
|
issubclassof(Sub,
Super)
Check whether a class is a sub-class of a super class. |
|
|
|
len2(items)
Make built-in function len work for
generators, iterators, etc. |
|
|
|
|
|
map1(func,
*xs)
Apply each argument to a single-argument function and return a
tuple of results. |
|
|
|
map2(func,
*xs)
Apply arguments to a function and return a tuple of
results. |
|
|
|
|
|
|
|
PI = 3.14159265359
|
|
EPS = 2.22044604925e-16
Epsilon (float ) 2**-52?
|
|
MANTIS = 53
Mantissa bits ≈53 (int )
|
|
MAX = 1.79769313486e+308
Float max (float ) ≈10**308, 2**1024?
|
|
MIN = 2.22507385851e-308
System's float min (float )
|
|
EPS_2 = 1.11022302463e-16
EPS / 2 ≈1.110223024625e-16
(float )
|
|
EPS1 = 1.0
1 - EPS ≈0.9999999999999998
(float )
|
|
EPS1_2 = 1.0
1 - EPS_2 ≈0.9999999999999999
(float )
|
|
INF = inf
Infinity (float ), see function isinf ,
isfinite
|
|
NAN = nan
Not-A-Number (float ), see function isnan
|
|
NEG0 = -0.0
Negative 0.0 (float ), see function isneg0
|
|
PI2 = 6.28318530718
Two PI, PI * 2 aka Tau (float ) #
PYCHOK expected
|
|
PI_2 = 1.57079632679
Half PI, PI / 2 (float )
|
|
PI_4 = 0.785398163397
Quarter PI, PI / 4 (float )
|
|
R_M = 6371008.77141
Mean, spherical earth radius (meter ).
|