integer division in php

Posted by oezi on Stack Overflow See other posts from Stack Overflow or by oezi
Published on 2010-04-20T08:58:11Z Indexed on 2010/04/20 9:03 UTC
Read the original article Hit count: 235

Filed under:
|
|

hi guys,

i'm looking for the fastest way to do an integer division in php. for example, 5 / 2 schould be 4 | 6 / 2 should be 3 and so on. if i simply do this, php will return 2.5 in the first case, the only solution i could find was using intval($my_number/2) - wich isn't as fast as i want it to be (but gives the expected results).

can anyone help me out with this?

© Stack Overflow or respective owner

Related posts about php

Related posts about math