Guardian Native C Library Calls Reference Manual (G06.29+, H06.08+, J06.03+)
rintf(3) Guardian Native C Library Calls Reference Manual
NAME
rintf - Rounds float number to nearest integral value
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 rintf(
float x);
PARAMETERS
x Is the float value to be rounded.
DESCRIPTION
The rintf() function is a float version of the rint() function; it takes a float argument and returns
a float result.
The rintf() function returns the integral value (as a float) nearest the value of the x parameter in
the direction of the current rounding mode.
If the current rounding mode rounds in the direction of negative infinity, the rintf() function is
identical to the floorf() function. If the current rounding mode rounds in the direction of positive
infinity, the rintf() function is identical to the ceilf() function.
NOTES
The rintf() function can be called only by native processes.
This function supports both IEEE Std 754-1985 floating-point and Tandem floating-point values.
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.
Remember the following rules when using any special floating-point mode:
• Do not assume that functions such as printf() or tanhf() behave correctly if you call
them after setting a nondefault operating mode (such as rounding toward zero). Unless a
function is documented as tolerating such modes, you should restore the default operat-
ing mode before calling the function.
• The exception bits of the floating-point status register stay set until they are explicitly
cleared.
RETURN VALUES
On successful completion, the rintf() function returns the integral value (as a float) nearest the
value of the x parameter in the direction of the current rounding mode.
For IEEE floating-point values, when the value of x is positive or negative infinity, the rintf()
function returns the value of x. If the value of x is NaN, the function returns NaN.
ERRORS
5−128 Hewlett-Packard Company 527192-018