rounding problems

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
Ollie Saunders
DevNet Master
Posts: 3179
Joined: Tue May 24, 2005 6:01 pm
Location: UK

Post by Ollie Saunders »

Yeah it rounds up and that is the way it is done in math. Anything else would be silly with the exception of converting to integer which works how it does for performance reasons. I think the fact that it is occasionally rounded down is due to a buggy implementation of floating point in PHP.
Post Reply