Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
modff(3) Guardian Native C Library Calls Reference Manual
NAME
modff - Breaks a float 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>
float modff(
float value,
float *int_ptr
);
PARAMETERS
value Specifies the float value to be broken into integral and fractional parts.
int_ptr 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 modff( ) function is a float version of the modf() function; it takes float arguments and
returns a float result.
The modff( ) 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 float 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 modff() 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 modff() function returns 0.0 (zero).
ERRORS
No error values are returned. This function does not set errno.
4−112 Hewlett-Packard Company 527192-018