- Ceil() is also Called as "Round Up"
- floorl Function Evaluates "floorl finds the Smallest (long double) integer not Less than x."
- Ceil() Returns the Smallest integral value that is not Less than x.
- Suppose num = 12.1 then ceil(num) Returns 13
- Header File : Math.h
Live Example :double ceil (double x); float ceil (float x); long double ceil (long double x);
Output :/* floor example */ #include<stdio.h> #include<math.h> int main () { printf ("ceil of 4.5 is %f\n", ceil(4.5)); printf ("ceil of 6.1 is %f\n", ceil(6.1)); printf ("ceil of -2.3 is %f\n", ceil(-2.3)); printf ("ceil of -3.8 is %f\n", ceil(-3.8)); return 0; }
Negative Parameter ???floor of 4.5 is 5 floor of 6.1 is 7 floor of -2.3 is -2 floor of -3.8 is -3
- As we Move Towards Positive Direction , we can conclude that -
5 > 4 > 3 > 2 > 1
- So ceil(3.2) Returns ==> 4
- As we Move Towards Negative Direction , we can conclude that -
-1 > -2 > -3 > -4 > -5
- So ceil(-3.2) Returns ==> -3





0 Comments:
Post a Comment
Your Feedback :This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email