On this page
  1. math.fsum
  2. Import
  3. Signature & Overview
  4. Usage
  5. Gotchas
  6. REPL Inspect

math.fsum

Prev: math.frexp | Up: math | Next: math.gamma
Rel: math.acos, math.acosh, math.asin, math.asinh
Ref: docs.python.org — math.fsum
Tags: #public #python3 #stdlib #math


Import

import math
from math import fsum

Signature & Overview

math.fsum(seq, /)

Return an accurate floating-point sum of values in the iterable seq.

Usage

import math

vals = [0.1] * 10
assert math.fsum(vals) == 1.0

Gotchas

REPL Inspect

from math import fsum
help(fsum)

Linked from

Related notes