Wrong error message for (mod 3.0 3)

Bug #173042 reported by Michael D. Adams
2
Affects Status Importance Assigned to Milestone
Ikarus Scheme
Fix Released
Medium
Abdulaziz Ghuloum

Bug Description

First I'm not sure whether this should even be throwing an error (I presume it should). Second, the error message is completely opaque: it should be from mod not quotient+remainder and claiming 1/2251799813685248 is "not a number" is bogus.

> (mod 3.0 3)
Unhandled exception
 Condition components:
   1. &error
   2. &who: quotient+remainder
   3. &message: "not a number"
   4. &irritants: (1/2251799813685248)

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

div, mod, div-and-mod, div0, mod0, div0-and-mod0 are all generic: they work on all types of numbers. Fun continues.

Changed in ikarus:
assignee: nobody → aghuloum
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

div and mod were fixed in revision 1168. div0 and mod0 are still broken.

Revision history for this message
Michael D. Adams (mdmkolbe) wrote :

I am not able to reproduce this bug for div0 or mod0 any more. Has it already been fixed?

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

I haven't touched them. quotient+remainder may have been fixed as part of div-and-mod. This may be open because it returns incorrect values, does not check its own arguments, or something else I don't remember.

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

Yeah it's broken.

> (div0 3.5 3)
Unhandled exception
 Condition components:
   1. &assertion
   2. &who: div0-and-mod0
   3. &message: "not an integer"
   4. &irritants: (3.5)

> (div 3.5 3)
1.0

> (mod0 3.5 3)
Unhandled exception
 Condition components:
   1. &assertion
   2. &who: div0-and-mod0
   3. &message: "not an integer"
   4. &irritants: (3.5)

> (mod 3.5 3)
0.5

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

Fixed in revision 1362. Thanks for the reminder :-)

Changed in ikarus:
status: Confirmed → Fix Committed
Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

This bug report is about to be closed as the fix comitted
previously will be incorporated in the next 0.0.3 release of
Ikarus Scheme, scheduled for January 31, 2008. A release
candidate tarball is available for download from:
http://www.cs.indiana.edu/~aghuloum/ikarus/ikarus-0.0.3-rc1.tar.gz
Please do test it if you have the time and report any issues
you might encounter. Thank you very much for your support.
(Sorry for the duplicates; I'm updating every open bug.)

Changed in ikarus:
milestone: none → 0.0.3
Changed in ikarus:
status: Fix Committed → Fix Released
Revision history for this message
leppie (leppie) wrote :

And some more 'fun':

Ikarus Scheme version 0.0.3+ (revision 1413, build 2008-03-13)
Copyright (c) 2006-2008 Abdulaziz Ghuloum

> (mod 3 5/6)
18/5

Should be 1/2.

Revision history for this message
leppie (leppie) wrote :

Btw, I think I see where you made an error, you scaling up, but forget to scale down again on the mod part, no need for the div part.

Revision history for this message
leppie (leppie) wrote :

Some more:

> (mod0 3 5/6)
83/30

Should be -1/3.

Revision history for this message
Abdulaziz Ghuloum (aghuloum) wrote :

Thanks leppie! Fixed in revision 1419.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.