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) float64

Parameters & Attributes

NameTypeDescription
xfloat64First input operand (or sole input if unary).
yfloat64Second input operand.
zfloat64Third 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))}
Go Reference