Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)

OSS Library Calls (i - m) modf(3)
NAME
modf - Breaks a floating-point number into integral and fractional parts
LIBRARY
G-series native Guardian processes: $SYSTEM.SYSnn.ZCRESRL
G-series native OSS processes: /G/system/sysnn/zcresrl
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>
double modf(
double value,
double *int_pointer
);
PARAMETERS
value Specifies the double value to be broken into integral and fractional parts.
int_pointer Is a pointer specifying where to store the signed integral part.
DESCRIPTION
Every nonzero number can be written uniquely as x times 2 raised to the power n, where the
mantissa (fraction), x, is in the range 0.5 | x | < 1.0, and the exponent, n, is an integer.
The modf( ) function breaks the value parameter into an integral and fractional part, each of
which has the same sign as the value parameter. It stores the integral part of value as a double in
the location pointed to by the int_pointer parameter.
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 Programmer’s Guide for a discussion of floating-point conversions.
RETURN VALUES
Upon successful completion, the modf( ) function returns the signed fractional part of value and
stores the signed integral part of value in the object pointed to by int_pointer.
For IEEE floating-point values, if the value of value is a NaN, then NaN is returned and a NaN is
stored in the object pointed to by int_pointer. If the value of value is positive infinity, then posi-
tive 0.0 (zero) is returned and positive infinity is stored in the object pointed to by int_pointer.If
the value of value is negative infinity, then negative 0.0 (zero) is returned and negative infinity is
stored in the object pointed to by int_pointer.
If the correct result would cause underflow, the modf( ) function returns 0.0 (zero).
ERRORS
No error values are returned. This function does not set errno.
RELATED INFORMATION
Functions: fp_class(3), frexp(3), isnan(3), ldexp(3).
527187-017 Hewlett-Packard Company 4207