Open System Services Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
OSS Library Calls (i - m) modfl(3)
NAME
modfl - Breaks a long double number into integral and fractional parts
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>
long double modfl(
long double value,
long double *int_ptr
);
PARAMETERS
value Specifies the long 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 modfl( ) function is a long double version of the modfl( ) function; it takes long double argu-
ments and returns a long double result.
The modfl( ) 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 long dou-
ble in the location pointed to by the int_ptr 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 modfl( ) function returns the signed fractional part of value and
stores the signed integral part of value in the object pointed to by int_ptr.
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_ptr. If the value of value is positive infinity, then positive
0.0 (zero) is returned and positive infinity is stored in the object pointed to by int_ptr. 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_ptr.
If the correct result would cause underflow, the modfl( ) function returns 0.0 (zero).
ERRORS
No error values are returned. This function does not set errno.
527187-017 Hewlett-Packard Company 4−211