Questions tagged [ceil]

A function common to many programming languages that returns the next integer value by rounding the value up if necessary.

Returns the next highest integer value by rounding up value if necessary. php.net

Examples

echo ceil(1.3);    // returns   2
echo ceil(10.9);   // returns  11
echo ceil(-3.14);  // returns  -3
301 questions
-5
votes
2 answers

What on earth is PHP doing here? A bug right?

Why on Earth does $r2 have the value 2027? $r1 = ceil( 10.26 * 100); //equals 1026 - CORRECT. $r2 = ceil( 20.26 * 100); //equals 2027 - WRONG! (I guess for some reason (20.26 * 100) does not result in an exact integer, but WHY??!? Isn't this a…
Tom Carnell
  • 585
  • 8
  • 14
1 2 3
20
21