whole number division

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

Post Reply
snx
Forum Newbie
Posts: 9
Joined: Wed Aug 31, 2005 6:15 pm

whole number division

Post by snx »

hi, i am having trouble finding information about whole number division with php:


assuming 77/10:

floor(76/10) = 7
the remainder: 76%10=6

that seems right to me but just want to clarify

thx
j.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

yeah...that's how it's done for small integers... you could use bcmath or gmp, if your server supports them, for larger integer math...
Post Reply