floor function and Ceil function

Source: Internet
Author: User
Tags floor function
Floor function floor (x), sometimes it is also written as floor (x), its function is "rounding", or "rounded down", that is, take the largest integer not greater than X (and "Rounding", the next rounding is directly remove the decimal part), such as: X=3.   14,floor (x) =3 Y=9.99999,floor (y) =9 in the C language library function, the syntax of the floor function is as follows: #include <math.h> double floor (double arg); Function: function returns the largest integer with an argument not greater than ARG.   For example, x = 6.04;   y = floor (x); The value of Y is 6.0. The floor function corresponds to the Ceil function, which is the upper integer function. Ceil function

The role of the Ceil function is to find the smallest integer that is not less than the given real number.

Ceil (2) =ceil (1.2) =cei (1.5) =2.00

Use this function to include the header file <math.h> The function returns a double type

Note: According to authoritative data, the return values of the floor function and the Ceil function are double type

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.