Intel® oneAPI DPC++/C++ Compiler Developer Guide and Reference

ID 767253
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Remainder Functions

Many routines in the Intel® oneAPI DPC++/C++ Compiler Math Library are more optimized for Intel® microprocessors than for non-Intel microprocessors.

The mathimf.h header file includes prototypes for Intel® oneAPI DPC++/C++ Compiler Math Library functions.

The math library supports the following remainder functions:

NOTE:

FP16 Math Functions have the following requirements:

  • Version 2021.4 or higher of the Intel® oneAPI DPC++/C++ Compiler.

  • A next-generation Intel® Xeon® Scalable processor, code name Sapphire Rapids.

fmod

Description: The fmod function returns the value x-n*y for integer n such that if y is nonzero, the result has the same sign as x and magnitude less than the magnitude of y.

errno: EDOM, for y = 0

Calling interface:
double fmod(double x, double y);
long double fmodl(long double x, long double y);
float fmodf(float x, float y);
_Float16 fmodf16(_Float16 x, _Float16 y);

remainder

Description: The remainder function returns the value of x REM y as required by the IEEE standard.

errno: EDOM, for y = 0

Calling interface:
double remainder(double x, double y);
long double remainderl(long double x, long double y);
float remainderf(float x, float y);
_Float16 remainderf16(_Float16 x, _Float16 y);

remquo

Description: The remquo function returns the value of x REM y. In the object pointed to by quo the function stores a value whose sign is the sign of x/y and whose magnitude is congruent modulo 2n of the integral quotient of x/y. N is an implementation-defined integer. For all systems, N is equal to 31.

errno: EDOM, for y = 0

Calling interface:
double remquo(double x, double y, int *quo);
long double remquol(long double x, long double y, int *quo);
float remquof(float x, float y, int *quo);
_Float16 remquof16(_Float16 x, _Float16 y, int *quo);