[macruby-changes] [2140] MacRuby/branches/experimental/complex.c

source_changes at macosforge.org source_changes at macosforge.org
Sat Aug 1 20:40:52 PDT 2009


Revision: 2140
          http://trac.macosforge.org/projects/ruby/changeset/2140
Author:   lsansonetti at apple.com
Date:     2009-08-01 20:40:51 -0700 (Sat, 01 Aug 2009)
Log Message:
-----------
raise exception in case we try to divide by zero

Modified Paths:
--------------
    MacRuby/branches/experimental/complex.c

Modified: MacRuby/branches/experimental/complex.c
===================================================================
--- MacRuby/branches/experimental/complex.c	2009-08-02 03:40:33 UTC (rev 2139)
+++ MacRuby/branches/experimental/complex.c	2009-08-02 03:40:51 UTC (rev 2140)
@@ -784,6 +784,9 @@
 static VALUE
 nucomp_div(VALUE self, SEL sel, VALUE other)
 {
+    if (f_zero_p(other)) {
+	rb_raise_zerodiv();
+    }
     return f_divide(self, other, f_quo, id_quo);
 }
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090801/1ed9f9b0/attachment.html>


More information about the macruby-changes mailing list