Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ floor(3m) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

abs



FLOOR(3m,L)                 AIX Technical Reference                 FLOOR(3m,L)



-------------------------------------------------------------------------------
floor, ceil, fmod, fabs, rint



PURPOSE

Computes floor, ceiling, remainder, and absolute value functions.

LIBRARY

Math Library (libm.a)

SYNTAX

#include <math.h>




                double floor (x)            double fmod (x, y)
                double x;                   double x, y;

                double ceil (x)             double fabs (x)
                double x;                   double x;

                #include <stdlib.h>
                #include <limits.h>

                double rint (x)
                double x;



DESCRIPTION

The floor subroutine returns the largest integer (as a double) not greater than
the x parameter.

The ceil subroutine returns the smallest integer not less than the x parameter.

The fmod subroutine returns the remainder of x / y.  More precisely, this value
is x if the y parameter is 0.  Otherwise, it is the number f with the same sign
as x such that x = iy + f for some integer i, and |f| < |y|.

The fabs subroutine returns the absolute value of x, |x|.

The rint subroutine returns one of the two nearest floating point integers to
x.  Which integer is returned is determined by the current floating point
rounding mode.





Processed November 7, 1990        FLOOR(3m,L)                                 1





FLOOR(3m,L)                 AIX Technical Reference                 FLOOR(3m,L)



If the current rounding mode is round toward -infinity, then rint(x) is
identical to floor(x).

If the current rounding mode is round toward +infinity, then rint(x) is
identical to ceil(x).

If the current rounding mode is round to nearest, then rint(x) rounds to the
nearer of the two nearest floating point integers.

If the current rounding mode is round toward zero, then rint(x) is equivalent
to truncating the fractional bits of x.

Note:  The default floating point rounding mode is round towards zero.

ERROR CONDITIONS

The floor, ceil, fmod, and fabs subroutines fail if one or more of the
following are true:

EDOM      The value of x is NaN.

EDOM      The argument y is zero or one of the arguments is NaN.

ERANGE    The result would cause an overflow.

RELATED INFORMATION

In this book:  "abs."



























Processed November 7, 1990        FLOOR(3m,L)                                 2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026