Standard library / math
math.FMA()
Computes x*y+z with a single rounding rather than rounding the product separately. Expected stdout: '10\n'.
Formal Syntax & Structure
go syntaxgo
func FMA(x, y, z float64) float64Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| x | float64 | First input operand (or sole input if unary). |
| y | float64 | Second input operand. |
| z | float64 | Third operand. |
Return Value
float64
Computes x*y+z with a single rounding rather than rounding the product separately.
Working Example
Example Snippetgo
package main
import ( "fmt" "math")
func main() { fmt.Println(math.FMA(2, 3, 4))}