.\" Modified 2004-11-15, Added further text on FLT_ROUNDS
.\" as suggested by AEB and Fabian Kreutz
.\"
-.TH FMA 3 2013-09-17 "" "Linux Programmer's Manual"
+.TH FMA 3 2017-09-15 "" "Linux Programmer's Manual"
.SH NAME
fma, fmaf, fmal \- floating-point multiply and add
.SH SYNOPSIS
.nf
.B #include <math.h>
-.sp
+.PP
.BI "double fma(double " x ", double " y ", double " z );
-.br
.BI "float fmaf(float " x ", float " y ", float " z );
-.br
.BI "long double fmal(long double " x ", long double " y ", long double " z );
.fi
-.sp
+.PP
Link with \fI\-lm\fP.
-.sp
+.PP
.in -4n
Feature Test Macro Requirements for glibc (see
.BR feature_test_macros (7)):
.in
-.sp
+.PP
.ad l
.BR fma (),
.BR fmaf (),
.BR fmal ():
.RS 4
-_XOPEN_SOURCE\ >=\ 600 || _ISOC99_SOURCE ||
-_POSIX_C_SOURCE\ >=\ 200112L;
-.br
-or
-.I cc\ -std=c99
+_ISOC99_SOURCE || _POSIX_C_SOURCE\ >=\ 200112L
.RE
.ad
.SH DESCRIPTION
-The
-.BR fma ()
-function computes
+These functions compute
.IR x " * " y " + " z .
The result is rounded as one ternary operation according to the
current rounding mode (see
These functions return the value of
.IR x " * " y " + " z ,
rounded as one ternary operation.
-
+.PP
If
.I x
or
.I y
is a NaN, a NaN is returned.
-
+.PP
If
.I x
times
is an infinity with the opposite sign,
a domain error occurs,
and a NaN is returned.
-
+.PP
.\" POSIX.1-2008 allows some possible differences for the following two
.\" domain error cases, but on Linux they are treated the same (AFAICS).
.\" Nevertheless, we'll mirror POSIX.1 and describe the two cases
a NaN is returned.
.\" POSIX.1 says that a NaN or an implementation-defined value shall
.\" be returned for this case.
-
+.PP
If one of
.I x
or
.\" POSIX.1 makes the domain error optional for this case.
a domain error occurs, and
a NaN is returned.
-
+.PP
If
.I x
times
.I z
is a NaN,
a NaN is returned.
-
+.PP
If the result overflows,
a range error occurs, and
an infinity with the correct sign is returned.
-
+.PP
If the result underflows,
a range error occurs, and
a signed 0 is returned.
.SH VERSIONS
These functions first appeared in glibc in version 2.1.
.SH ATTRIBUTES
-.SS Multithreading (see pthreads(7))
-The
+For an explanation of the terms used in this section, see
+.BR attributes (7).
+.TS
+allbox;
+lbw21 lb lb
+l l l.
+Interface Attribute Value
+T{
.BR fma (),
.BR fmaf (),
-and
.BR fmal ()
-functions are thread-safe.
+T} Thread safety MT-Safe
+.TE
.SH CONFORMING TO
-C99, POSIX.1-2001.
+C99, POSIX.1-2001, POSIX.1-2008.
.SH SEE ALSO
.BR remainder (3),
.BR remquo (3)