2004-11-03 13:51:07 +00:00
|
|
|
.\" Copyright 2002 Walter Harms (walter.harms@informatik.uni-oldenburg.de)
|
|
|
|
.\" Distributed under GPL, 2002-07-27 Walter Harms
|
2004-11-15 10:55:23 +00:00
|
|
|
.\" Modified 2004-11-15, Added further text on FLT_ROUNDS
|
|
|
|
.\" as suggested by AEB and Fabian Kreutz
|
2004-11-03 13:51:07 +00:00
|
|
|
.\"
|
|
|
|
.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 );
|
2004-11-11 17:28:42 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "float fmaf(float " x ", float " y ", float " z );
|
2004-11-11 17:28:42 +00:00
|
|
|
.br
|
2004-11-03 13:51:07 +00:00
|
|
|
.BI "long double fmal(long double " x ", long double " y ", long double " z );
|
|
|
|
.fi
|
|
|
|
.sp
|
2007-05-21 09:56:00 +00:00
|
|
|
Compile with \fI\-std=c99\fP; link with \fI\-lm\fP.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH DESCRIPTION
|
2007-04-12 22:42:49 +00:00
|
|
|
The
|
2005-10-19 07:07:02 +00:00
|
|
|
.BR fma ()
|
2004-11-03 13:51:07 +00:00
|
|
|
function computes
|
|
|
|
.IR x " * " y " + " z .
|
|
|
|
The result is rounded according to the
|
2007-06-22 19:42:52 +00:00
|
|
|
rounding mode determined by the value of
|
|
|
|
.BR FLT_ROUNDS .
|
|
|
|
.B FLT_ROUNDS
|
|
|
|
indicates the implementation-defined rounding
|
2007-06-08 09:56:56 +00:00
|
|
|
behavior for floating-point addition,
|
2004-11-15 10:55:23 +00:00
|
|
|
and has one of the following values:
|
|
|
|
.IP \-1
|
|
|
|
The rounding mode is not determinable.
|
|
|
|
.IP 0
|
2004-11-15 12:35:29 +00:00
|
|
|
Rounding is towards 0.
|
2004-11-15 10:55:23 +00:00
|
|
|
.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.
|
2004-11-03 13:51:07 +00:00
|
|
|
.SH "CONFORMING TO"
|
|
|
|
C99
|
|
|
|
.SH "SEE ALSO"
|
2004-11-15 11:41:22 +00:00
|
|
|
.BR fenv (3),
|
2004-11-03 13:51:07 +00:00
|
|
|
.BR remainder (3),
|
|
|
|
.BR remquo (3)
|