Package pygeodesy :: Module constants
[frames] | no frames]

Module constants

Single-instance float and int constants across pygeodesy modules and related functions pygeodesy.float_, pygeodesy.isclose, pygeodesy.isfinite, pygeodesy.isinf, pygeodesy.isint0, pygeodesy.isnan, pygeodesy.isnear0, pygeodesy.isnear1, pygeodesy.isnear90, pygeodesy.isneg0, pygeodesy.isninf, pygeodesy.isnon0 and pygeodesy.remainder.


Version: 24.04.23

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).
 
float_(*fs, **sets)
Get scalars as float or intern'ed float.
 
float0_(*xs)
Yield xs as a non-NEG0 float.
 
isclose(a, b, rel_tol=1e-12, abs_tol=4.930380657631324e-32)
Like math.isclose, but with defaults such that isclose(0, EPS0) is True by default.
 
isfinite(obj)
Check a finite scalar or complex value.
 
isint0(obj, both=False)
Check for INT0 or int(0) value.
 
isnear0(x, eps0=4.930380657631324e-32)
Is x near zero within a tolerance?
 
isnear1(x, eps1=4.930380657631324e-32)
Is x near one within a tolerance?
 
isnear90(x, eps90=4.930380657631324e-32)
Is x near 90 within a tolerance?
 
isneg0(x)
Check for NEG0, negative 0.0.
 
isninf(x)
Check for NINF, negative INF.
 
isnon0(x, eps0=4.930380657631324e-32)
Is x non-zero with a tolerance?
 
remainder(x, y)
Mimick Python 3.7+ math.remainder.
Variables
  __all__ = _ALL_LAZY.constants
  DIG = 15
  EPS = 2.220446049250313e-16
  MANT_DIG = 53
  MAX = 1.7976931348623157e+308
  MAX_EXP = 1024
  MIN = 2.2250738585072014e-308
  MIN_EXP = -1021
  EPS0 = 4.930380657631324e-32
  EPS02 = 2.4308653429145085e-63
  EPS_2 = 1.1102230246251565e-16
  EPS1 = 0.9999999999999998
  EPS2 = 4.440892098500626e-16
  EPS4 = 8.881784197001252e-16
  INF = inf
  INT0 = 0
  NAN = nan
  NEG0 = -0.0
  NINF = -inf
  PI = 3.141592653589793
  PI2 = 6.283185307179586
  PI_2 = 1.5707963267948966
  PI3 = 9.42477796076938
  PI3_2 = 4.71238898038469
  PI_3 = 1.0471975511965976
  PI4 = 12.566370614359172
  PI_4 = 0.7853981633974483
  R_MA = 6378137.0
  R_MB = 6356752.3
  R_M = 6371008.771415
  R_KM = 6371.0087714149995
  R_NM = 3440.06953100162
  R_SM = 3958.7613160486508
  R_FM = 6371000.0
  R_GM = 6371230.0
  R_QM = 6372797.560856
  R_VM = 6366707.0194937
Function Details

float_ (*fs, **sets)

 

Get scalars as float or intern'ed float.

Arguments:
  • fs - One more values (scalar), all positional.
  • sets - Use sets=True to intern each fs, otherwise don't intern.
Returns:
A single float if only one fs is given, otherwise a tuple of floats.
Raises:
  • TypeError - Some fs is not scalar.

isfinite (obj)

 

Check a finite scalar or complex value.

Arguments:
  • obj - Value (scalar or complex).
Returns:
False if obj is INF, NINF or NAN, True otherwise.
Raises:
  • TypeError - Non-scalar and non-complex obj.

isint0 (obj, both=False)

 

Check for INT0 or int(0) value.

Arguments:
  • obj - The object (any type).
  • both - If true, also check float(0) (bool).
Returns:
True if obj is INT0, int(0) or float(0), False otherwise.

isnear0 (x, eps0=4.930380657631324e-32)

 

Is x near zero within a tolerance?

Arguments:
  • x - Value (scalar).
  • eps0 - Near-zero tolerance (EPS0).
Returns:
True if abs(x) < eps0, False otherwise.

See Also: Function isnon0.

isnear1 (x, eps1=4.930380657631324e-32)

 

Is x near one within a tolerance?

Arguments:
  • x - Value (scalar).
  • eps1 - Near-one tolerance (EPS0).
Returns:
isnear0(x - 1, eps0=eps1).

See Also: Function isnear0.

isnear90 (x, eps90=4.930380657631324e-32)

 

Is x near 90 within a tolerance?

Arguments:
  • x - Value (scalar).
  • eps90 - Near-90 tolerance (EPS0).
Returns:
isnear0(x - 90, eps0=eps90).

See Also: Function isnear0.

isneg0 (x)

 

Check for NEG0, negative 0.0.

Arguments:
  • x - Value (scalar).
Returns:
True if x is NEG0 or -0.0, False otherwise.

isninf (x)

 

Check for NINF, negative INF.

Arguments:
  • x - Value (scalar).
Returns:
True if x is NINF or -inf, False otherwise.

isnon0 (x, eps0=4.930380657631324e-32)

 

Is x non-zero with a tolerance?

Arguments:
  • x - Value (scalar).
  • eps0 - Non-zero tolerance (EPS0).
Returns:
True if abs(x) > eps0, False otherwise.

See Also: Function isnear0.