mirror of https://github.com/mkerrisk/man-pages
51 lines
1.3 KiB
Groff
51 lines
1.3 KiB
Groff
.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
|
|
.\" Distributed under GPL, 2002-07-27 Walter Harms
|
|
.\" Modified 2004-11-15, Added further text on FLT_ROUNDS
|
|
.\" as suggested by AEB and Fabian Kreutz
|
|
.\"
|
|
.TH FMA 3 2002-07-27 "" "Linux Programmer's Manual"
|
|
.SH NAME
|
|
fma, fmaf, fmal \- floating-point multiply and add
|
|
.SH SYNOPSIS
|
|
.nf
|
|
.B #include <math.h>
|
|
.sp
|
|
.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
|
|
Compile with \fI\-std=c99\fP; link with \fI\-lm\fP.
|
|
.SH DESCRIPTION
|
|
The
|
|
.BR fma ()
|
|
function computes
|
|
.IR x " * " y " + " z .
|
|
The result is rounded according to the
|
|
rounding mode determined by the value of
|
|
.BR FLT_ROUNDS .
|
|
.B FLT_ROUNDS
|
|
indicates the implementation-defined rounding
|
|
behavior for floating-point addition,
|
|
and has one of the following values:
|
|
.IP \-1
|
|
The rounding mode is not determinable.
|
|
.IP 0
|
|
Rounding is towards 0.
|
|
.IP 1
|
|
Rounding is towards nearest number.
|
|
.IP 2
|
|
Rounding is towards positive infinity.
|
|
.IP 3
|
|
Rounding is towards negative infinity.
|
|
.PP
|
|
Other values represent machine-dependent, non-standard rounding modes.
|
|
.SH "CONFORMING TO"
|
|
C99
|
|
.SH "SEE ALSO"
|
|
.BR fenv (3),
|
|
.BR remainder (3),
|
|
.BR remquo (3)
|