This is the mail archive of the kawa@sourceware.org mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

bug #27553 - patch


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

Not sure if this is "the right way" to solve this bug. I wanted the
stack trace for (/ 1 0) to be the same as (/ 0 0), so that's why I've
called IntNum.quotient(), I could have raised the exception immediately,
but I thought consistency would be appreciated.

Patch attached.

Charles.

p.s. This page, http://www.gnu.org/software/kawa/Reporting-bugs.html
links to a rotten URL for bug-kawa archives,

http://lists.gnu.org/mailman/listinfo/bug-kawa

gives me a 404 at least.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQEcBAEBAgAGBQJNo0l2AAoJEG9M6fiX7bE4IOkH/0Y2LS8ZYHZBXVy72jMn6j7V
hnvkky1wLYSHUygVY7X3F8iE6EH5oYl6G1ABVxHxlDXobnsXu8q824ICNWM8AoKH
7YSNMLn/lYNNxG3wgWQxIoEoP99OPabaGVtyrEvDBvWktt02++U1x5E8ZEA014QY
+2coEmSaZvEbm+gbxLbC/iAtlgjNCcVKudkVG2NasiGuh9u4dIAlnePB93FmuFtq
AZ/jvbH7IU7R7MLiEkhzdw9hfwsne/W0+ZOojj6uDZb4QsfZ68HSksVHvKnSkKtV
IqzI6ROoNsDKK7AG+ZHQHVK6bB+ZjFumbIK/+blNObA0ZlUfBYmqmNkBtrShKCw=
=SbHG
-----END PGP SIGNATURE-----
Index: gnu/math/RatNum.java
===================================================================
--- gnu/math/RatNum.java        (revision 6950)
+++ gnu/math/RatNum.java        (working copy)
@@ -14,6 +14,9 @@
   public static RatNum make(IntNum num, IntNum den)
   {
     IntNum g = IntNum.gcd (num, den);
+    if (den.isZero())
+      // Force the error through the appropiate channels.
+      IntNum.quotient(num, den);
     if (den.isNegative ())
       g = IntNum.neg (g);
     if (! g.isOne ())

Attachment: divzero.patch.sig
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]