bugKawa - Bugs: bug #20123, Can't correctly divide...

 
 

bug #20123: Can't correctly divide 1307674368000/2874009600

Submitted by:  None
Submitted on:  Thu 07 Jun 2007 10:21:37 PM UTC  
 
Category: Scheme librarySeverity: 3 - Normal
Item Group: Bad diagnosticStatus: Fixed
Privacy: PublicAssigned to: Per Bothner <bothner>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 11 Jun 2007 02:24:45 AM UTC, comment #1:

Thanks! I checked in your patch (slightly edited).

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Thu 07 Jun 2007 10:21:37 PM UTC, original submission:

While doing some stochastics with the nice scheme implementation, I tried the above (i.e. 15!/(12!*3!) ) and get -920/-2 instead of 455.

It seemed a problem with calculating the gcd of the two numbers, because I got:
#|kawa:31|# (gcd 1307674368000 2874009600)
#|kawa:31|# -1420957696
Which certainly is wrong.

In the end I come two IntNum.java which ignores, if the result will become in conversation to the 2er complement too big.

I fixed it and it seems two work, see attachment. I also add a simple Test.

Thank You for the great tool!
Helge Dietert

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #12985:  patchBigInt added by None (1KiB - text/x-diff)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by bothner (Posted a comment)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 4 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 11 Jun 2007 02:24:45 AM UTCbothnerStatusNone=>Fixed
      Assigned toNone=>bothner
      Open/ClosedOpen=>Closed
    Thu 07 Jun 2007 10:21:37 PM UTCNoneAttached File-=>Added patchBigInt, #12985

    Back to the top


    Powered by Savane 3.1-cleanup1