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

Module fsums

Class Fsum for precision running floating point summation.

Set env variable PYGEODESY_FSUM_RESIDUAL to nay non-empty string to throw a ResidualError for division or exponention by an Fsum instance with a non-zero residual, see method Fsum.fsum2.


Version: 22.02.04

Classes
  ResidualError
Error raised for an operation involving an Fsum with a non-zero residual.
  Fsum
Precision running floating point summation similar to standard Python's math.fsum.
  Fsum2Tuple
2-Tuple (fsum, residual) with the precision running fsum and the residual, the sum of the remaining partials if any.
Functions
 
fsum(xs)
Precision floating point summation similar to Python's math.fsum.
 
fsum_(*xs)
Precision floating point summation of all positional arguments.
 
fsum1(xs)
Precision floating point summation of a few values, 1-primed.
 
fsum1_(*xs)
Precision floating point summation of a few arguments, 1-primed.
Variables
  __all__ = _ALL_LAZY.fsums
Function Details

fsum (xs)

 

Precision floating point summation similar to Python's math.fsum.

Exception and non-finite handling differ from math.fsum.

Arguments:
  • xs - Iterable, list, tuple, etc. of values (scalar or Fsum instances).
Returns:
Precision sum (float).
Raises:
  • OverflowError - Partial 2sum overflow.
  • TypeError - Non-scalar xs value.
  • ValueError - Invalid or non-finite xs value.

See Also: Class Fsum and methods Fsum.fsum and Fsum.fadd.

fsum_ (*xs)

 

Precision floating point summation of all positional arguments.

Arguments:
  • xs - Values to add (scalar or Fsuminstances), all positional.
Returns:
Precision sum (float).

See Also: Function fsum.

fsum1 (xs)

 

Precision floating point summation of a few values, 1-primed.

Arguments:
  • xs - Iterable, list, tuple, etc. of values (scalar or Fsum instances).
Returns:
Precision sum (float).

See Also: Function fsum.

fsum1_ (*xs)

 

Precision floating point summation of a few arguments, 1-primed.

Arguments:
  • xs - Values to add (scalar or Fsum instances), all positional.
Returns:
Precision sum (float).

See Also: Function fsum