Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

fmodf(3) Guardian Native C Library Calls Reference Manual
NAME
fmodf - Computes the modulo remainder of a division operation for float values
LIBRARY
H-series and J-series native Guardian processes: $SYSTEM.ZDLLnnn.ZCREDLL
32-bit H-series and J-series OSS processes: /G/system/zdllnnn/zcredll
64-bit H-series and J-series OSS processes: /G/system/zdllnnn/ycredll
SYNOPSIS
#include <math.h>
float fmodf(
float x,
float y
);
PARAMETERS
x Species the float value that is the numerator of the division.
y Species the float value that is the denominator of the division.
DESCRIPTION
The fmodf() function is a float version of the fmod() function; it takes float arguments and
returns a float result.
The fmodf() function computes the modulo floating-point remainder of x/y. The fmodf() func-
tion returns the value x -(i*y) for some i such that if y is nonzero, the result has the same sign as
x and magnitude less than the magnitude of y.
NOTES
This function supports both IEEE Std 754-1985 floating-point and Tandem floating-point values
in the native environment. IEEE values can include NaN and infinity, and the sign of 0.0 (zero)
can be either positive or negative. Refer to the fp_class(3) reference page for a description of
IEEE value classes.
Guardian functions are available to convert between floating-point formats. Refer to the Guar-
dian Programmers Guide for a discussion of floating-point conversions.
RETURN VALUES
Upon successful completion, the fmodf() function returns the modulo floating-point remainder of
the division of x by y.
For IEEE floating-point values, if x or y is NaN, NaN is returned. If the value of x is positive or
negative infinity, or if the value of y is 0.0 (zero), the fmodf() function returns NaN and sets
errno to [EDOM]. If the value of y is nonzero and the value of x is positive or negative zero, the
fmodf() function returns the value of x. If the value of x is not positive or negative infinity but
the value of y is positive or negative infinity, the fmodf() function returns the value of x.
For Tandem floating-point values, if the value of y is 0.0 (zero), the fmodf() function returns 0.0
(zero).
If the correct value would cause underflow, 0.0 (zero) is returned.
ERRORS
If any of the following conditions occurs, the fmodf() function sets errno to the corresponding
value:
[EDOM] The y parameter is 0.0 (zero) or the x parameter is positive or negative infinity.
260 Hewlett-Packard Company 527192-018