java - why i am getting different ceiling values for the same number -


i computing values , need find ceiling of number. know can use math.ceil(). issue is, when use math.ceil(,5) gives me 1, , math.ceil(50/100) gives me 0.

please let me know happening different ceilings different values

math.ceil(50/100) same math.ceil(0), since 50/100 0 (since integer division performed here, , result therefore integer).

math.ceil(50.0/100.0) give 1, since 50.0/100.0 computed floating point division , result in 0.5.


Comments

Popular posts from this blog

How to provide Authorization & Authentication using Asp.net, C#? -

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

How to use Authorization & Authentication in Asp.net, C#? -