[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1

ceil, ceilf, or ceill Subroutine

Purpose

Computes the ceiling value.

Syntax

#include <math.h>

float ceilf (x)
float x;

long double ceill (x)
long double x;

double ceil (x)
double x;

Description

The ceilf, ceill, and ceil subroutines compute the smallest integral value not less than x.

An application wishing to check for error situations should set the errno global variable to zero and call feclearexcept(FE_ALL_EXCEPT) before calling these functions. Upon return, if errno is nonzero or fetestexcept(FE_INVALID | FE_DIVBYZERO | FE_OVERFLOW | FE_UNDERFLOW) is nonzero, an error has occurred.

Parameters

x Specifies the smallest integral value to be computed.

Return Values

Upon successful completion, the ceilf, ceill , and ceil subroutines return the smallest integral value not less than x, expressed as a type float, long double, or double, respectively.

If x is NaN, a NaN is returned.

If x is ±0 or ±Inf, x is returned.

If the correct value would cause overflow, a range error occurs and the ceilf, ceill, and ceil subroutines return the value of the macro HUGE_VALF, HUGE_VALL, and HUGE_VAL, respectively.

Related Information

feclearexcept Subroutine, fetestexcept Subroutine, floor, floorf, floorl, nearest, trunc, itrunc, or uitrunc Subroutine, and class, _class, finite, isnan, or unordered Subroutines.

math.h in AIX 5L Version 5.2 Files Reference.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]