6.11.67 fmal Function

Returns the value of x * y + z for long double-precision floating-point values.

Include

<math.h>

Prototype

long double fmal(long double x, long double y, long double z);

Arguments

x
any double precision floating-point number
y
any double precision floating-point number
z
any double precision floating-point number

Return Value

Returns the value of x * y + z, computed as if in one operation with infinite precision and rounded to the rounding mode indicated by FLT_ROUNDS.

Example

#include <math.h>
#include <stdio.h>

int main(void)
{
  long double x, y, z, m;

  x = -5.7;
  y = 2.0;
  z = 1.0;
  m = fmal(x, y, z);
  printf("The multiplication of %Lf and %Lf summed with %Lf is %Lf\n\n", x, y, z, m);
}

Example Output

The multiplication of -5.700000 and 2.000000 summed with 1.000000 is -10.400000