Jump to content

ceil() help


leony

Recommended Posts

echo ceil(4/2);   // 2, as expected.

 

Floating point math rarely gives an exact value unless the fractional divisors are multiples of 2, (1/4, 3/4, 7/16, 23/128 etc) so if the result of your division is really 6.0000000000000001 then ceil() rounds up

 

Link to comment
https://forums.phpfreaks.com/topic/119543-ceil-help/#findComment-615941
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.