Share via


__fmac

9/7/2007

Multiplies two float values and add to a third float value.

Syntax

Float __fmac( 
  float Arg1, 
  float Arg1, 
  float Arg1 
);

Parameters

  • Arg1
    [in] First operand of the multiplication operation.
  • Arg2
    [in] Second operand of the multiplication operation.
  • Arg3
    [in] Value to which the product of Arg1and Arg2 is added.

Return Values

The sum of the product of Arg1 and Arg2 with Arg3.

Remarks

The following code example shows how to use _fmac.

/***********************************************************/
#include <stdio.h>
#include <shintr.h>
void main()
{
     int i;
     float sum=0;
     float v1[4] = {2.0, 2.0, 2.0, 2.0};
     float v2[4] = {8.0, 8.0, 8.0, 8.0};
         for (i = 0; i < 4; i++)
          sum = __fmac(v1[i], v2[i], sum);
         
     printf("sum = %f\n", sum);
}

This example results in the following output.

sum = 64.000000

Requirements

Routine Required header Architecture

__fmac

<shintr.h>

SH-4

See Also

Reference

Intrinsic Functions for Renesas Microprocessors