JS Ceil Function

Source: Internet
Author: User
Ceil Function

The Ceil function is used to evaluate the smallest integer not less than the given real number.

Ceil (2) = Ceil (1.2) = CEI (1.5) = 2.00

To use this function, you must include the header file <math. h>. The return value of this function is floating point.

Run-Time library referenceceil, ceilfcalculates the ceiling of a value.

Double Ceil (
Double X
);
Float Ceil (
Float x
); // C ++ only
Long Double Ceil (
Long Double X
); // C ++ only
Float ceilf (
Float x
);

Parameter
X
Floating-point value.
Return Value
The Ceil function returns a double value representing the smallest integer that is greater than or equal to X. There is no error return.

Input seh exception matherr exception
± Qnan, IND None _ domain

Ceil has an implementation that uses streaming SIMD extensions 2 (sse2). See _ set_sse2_enable for information and restrictions on using the sse2 implementation.

Remarks
C ++ allows overloading, so you can call overloads of Ceil. In a C program, Ceil always takes and returns a double.

Requirements
Routine required header compatibility
Ceil, ceilf <math. h> ANSI, WIN 98, win me, Win NT, Win 2000, Win XP

For additional compatibility information, see compatibility in the introduction.

Libraries

All versions of the C run-time libraries.

Example
See the example for floor.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.