[#21338] $SAFE=4 での autoload — Hidetoshi NAGAI <nagai@...>

永井@知能.九工大です.

21 messages 2003/09/04
[#21346] Re: $SAFE=4 での autoload — nobu.nakada@... 2003/09/04

なかだです。

[#21359] Re: $SAFE=4 での autoload — Hidetoshi NAGAI <nagai@...> 2003/09/05

永井@知能.九工大です.

[#21419] Makefile.inのlex.c — Kazuhiro NISHIYAMA <zn@...>

西山和広です。

15 messages 2003/09/28

[ruby-dev:21312] Forward: [PATCH] RE: BigDecimal Bugs

From: matz@... (Yukihiro Matsumoto)
Date: 2003-09-03 05:21:25 UTC
List: ruby-dev #21312
まつもと ゆきひろです

こんなパッチが来てます。もともとのレポートは[ruby-talk:80899]。

------- Start of forwarded message -------
Date: Wed, 3 Sep 2003 07:49:10 +0900
From: "Warren Brown" <wkb@airmail.net>
Reply-To: ruby-talk@ruby-lang.org
Subject: [PATCH] RE: BigDecimal Bugs

Bret,

> irb(main):001:0> require 'bigdecimal'
> true
> irb(main):002:0> a = BigDecimal.new("1")/BigDecimal.new("0")
> #<BigDecimal:400cc144,'Infinity',4(24)>
> irb(main):003:0> b = -a
> #<BigDecimal:400c43e0,'-Infinity',4(12)>
> irb(main):004:0> c = -b
> #<BigDecimal:400bc528,'-Infinity',4(12)>
> irb(main):005:0> a == b
> false
> irb(main):006:0> b == c # ?!!
> true

    This looks like a bug in bigdecimal.c at line 2046.  This patch should
fix it:

--- bigdecimal.c        Fri Aug  1 02:08:43 2003
+++ bigdecimal.c.new    Tue Sep  2 17:45:00 2003
@@ -2043,7 +2043,7 @@
         return 0;
     }
     if(VpIsInf(a)) {
-        VpSetInf(c,isw);
+        VpSetInf(c,isw*VpGetSign(a));
         return 0;
     }


    I know you have already fixed the negative infinity display bug, but for
completeness, here is the patch:

--- bigdecimal.h        Fri Aug  1 02:08:43 2003
+++ bigdecimal.h.new    Tue Sep  2 17:45:00 2003
@@ -26,7 +26,7 @@
 #define SZ_NaN  "NaN"
 #define SZ_INF  "Infinity"
 #define SZ_PINF "+Infinity"
-#define SZ_NINF "+Infinity"
+#define SZ_NINF "-Infinity"

 /*
  *   #define VP_EXPORT other than static to let VP_ routines



    I hope this helps.

    - Warren Brown



------- End of forwarded message -------

In This Thread

Prev Next