Math.IEEEremainder vs. %

J

jmw

Today I encountered some code using Math.IEEEremainder to calculate the
remainder of two ints, for a simple pagination calculation. I normally
would just use %, but I'm wondering if anyone knows of a specific
reason to use Math.IEEEremainder for this type of calculation instead.
 
D

Daniel Pitts

jmw said:
Today I encountered some code using Math.IEEEremainder to calculate the
remainder of two ints, for a simple pagination calculation. I normally
would just use %, but I'm wondering if anyone knows of a specific
reason to use Math.IEEEremainder for this type of calculation instead.

I have three thoughts why someone might do this.
They don't know how to cast to integer.
They don't know how to use %
They need to use the special rounding the IEEERemainder provides.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top