Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Math.IEEEremainder vs. %

Reply
Thread Tools

Math.IEEEremainder vs. %

 
 
jmw
Guest
Posts: n/a
 
      12-21-2006
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.

 
Reply With Quote
 
 
 
 
Daniel Pitts
Guest
Posts: n/a
 
      12-21-2006

jmw wrote:
> 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.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments