Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ remainder(3M) — DG/UX 5.4R3.00

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cc(1)

reentrant(3)

abs(3C)

matherr(3M)



floor(3M)                      DG/UX 5.4R3.00                      floor(3M)


NAME
       floor, floorf, ceil, ceilf, copysign, fmod, fmodf, fabs, fabsf, rint,
       remainder - floor, ceiling, remainder, absolute value functions

SYNOPSIS
       cc [flag ...] file ...  -lm [library ...]

       #include <math.h>

       double floor (double x);

       float floorf (float x);

       double ceil (double x);

       float ceilf (float x);

       double copysign (double x, double y);

       double fmod (double x, double y);

       float fmodf (float x, float y);

       double fabs (double x);

       float fabsf (float x);

       double rint (double x);

       double remainder (double x, double y);

DESCRIPTION
       floor and floorf return the largest integer not greater than x.  ceil
       and ceilf return the smallest integer not less than x.

       copysign returns x but with the sign of y.

       fmod and fmodf return the floating point remainder of the division of
       x by y.  More precisely, they return the number f with the same sign
       as x, such that x = iy + f for some integer i, and | f| <| y|.

       fabs and fabsf return the absolute value of x, | x|.

       rint returns the nearest integer value to its floating point argument
       x as a double-precision floating point number.  The returned value is
       rounded according to the currently set machine rounding mode.  If
       round-to-nearest (the default mode) is set and the difference between
       the function argument and the rounded result is exactly 0.5, then the
       result will be rounded to the nearest even integer.

       remainder returns the floating point remainder of the division of x
       by y.  More precisely, it returns the value r = x - yn, where n is
       the integer nearest the exact value x/y.  Whenever | n - x/y| = ½,
       then n is even.



Licensed material--property of copyright holder(s)                         1




floor(3M)                      DG/UX 5.4R3.00                      floor(3M)


       Those functions using float arguments, floorf, ceilf, fmodf, and fab­
       sf will give unpredictable results when used with the -Xt (which is
       the default) compilation option.  In traditional compilation mode
       float arguments are promoted to doubles.  An object compiled with -Xt
       will expect this promotion and therefore not work correctly with
       these functions.


   Considerations for Threads Programming
                     +----------+-----------------------------+
                     |          |                      async- |
                     |function  | reentrant   cancel   cancel |
                     |          |              point    safe  |
                     +----------+-----------------------------+
                     |ceil      |     Y          N        N   |
                     |ceilf     |     Y          N        N   |
                     |copysign  |     Y          N        N   |
                     |fabs      |     Y          N        N   |
                     |fabsf     |     Y          N        N   |
                     |floor     |     Y          N        N   |
                     |floorf    |     Y          N        N   |
                     |fmod      |     Y          N        N   |
                     |fmodf     |     Y          N        N   |
                     |remainder |     Y          N        N   |
                     |rint      |     Y          N        N   |
                     +----------+-----------------------------+

SEE ALSO
       cc(1), reentrant(3), abs(3C), matherr(3M).

DIAGNOSTICS
       fmod and fmodf return x when y is 0 and set errno to EDOM.  remainder
       returns NaN when y is 0 and sets errno to EDOM.  In both cases, ex­
       cept in compilation modes -Xa or -Xc, a message indicating DOMAIN er­
       ror is printed on standard error.  Except under -Xc, these error-
       handling procedures may be changed with the function matherr.





















Licensed material--property of copyright holder(s)                         2


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