Math.IEEEremainder vs. %

Discussion in 'Java' started by jmw, Dec 21, 2006.

  1. jmw

    jmw Guest

    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.
    jmw, Dec 21, 2006
    #1
    1. Advertising

  2. jmw

    Daniel Pitts Guest

    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.
    Daniel Pitts, Dec 21, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. chirs
    Replies:
    18
    Views:
    750
    Chris Uppal
    Mar 2, 2004
  2. AciD_X
    Replies:
    4
    Views:
    8,075
    Jonathan Turkanis
    Apr 1, 2004
  3. Mark Healey
    Replies:
    7
    Views:
    1,463
    Tim Prince
    May 22, 2006
  4. Philipp
    Replies:
    9
    Views:
    1,100
    Mark Space
    Jul 23, 2008
  5. VK
    Replies:
    15
    Views:
    1,130
    Dr J R Stockton
    May 2, 2010
Loading...

Share This Page