The math.fsum()
function calculates the total sum of the elements of an iterable object.
math.fsum(iterable)
copy
Where, the iterable
parameter is the iterable object such as a list, tuple, or range object, containing the sequence of numbers to be summed.
The function returns the sum of the elements in the iterable as a float. If the iterable is empty, the function returns 0.0.
Each element of the iterable must be an integer or a floating point value, otherwise, a TypeError
is raised.