Results 1 to 2 of 2

Thread: [RESOLVED] BigInteger remainder results in zero

Hybrid View

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Dec 2007
    Posts
    167

    Resolved [RESOLVED] BigInteger remainder results in zero

    Code:
    BigInteger nbr = BigInteger.valueOf(4);
    BigInteger i = BigInteger.valueOf(2);
    nbr.remainder(i) == BigInteger.ZERO
    this returns false, it should return true, the remainder is zero...
    why is it returning false?
    although if u check each one alone, they are ZEROS and they are equal!!!
    why is it returning false?
    Im using Visual Studio 2008 Professional Edition
    .Net Framework 3.5

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: BigInteger remainder results in zero

    use
    Code:
    nbr.remainder(i).equals(BigInteger.ZERO);
    to compare values the "==" compares references
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width