Math Functions
math.fma()
Compute a product plus an addend with one final floating-point rounding instead of rounding the product first. Added in 3.13.
Formal Syntax & Structure
python syntaxpython
math.fma(x, y, z, /)Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | real number | Input real value. |
| y | real number | Second real value. |
| z | real number | Addend in the fused operation. |
Return Value
float
Floating-point result; finite precision and domain restrictions apply.
Working Example
Example Snippetpython
import mathprint(math.fma(2.5, 4, -3))