[#144] Another implementation of Bignum — "Dmitry Antipov" <dmitry.antipov@...>
Hello Ruby hackers,
15 messages
2002/06/06
[#151] Re: Another implementation of Bignum [tarball attached]
— "Dmitry Antipov" <dmitry.antipov@...>
2002/06/07
Hello again,
[#152] Re: Another implementation of Bignum [tarball attached]
— matz@... (Yukihiro Matsumoto)
2002/06/07
Hi,
[#174] Improving Ruby's garbage collector for interactive apps — Matthew Bloch <mattbee@...>
re: this problem I had a few weeks back:
8 messages
2002/06/19
[#177] Re: Improving Ruby's garbage collector for interactive apps
— matz@... (Yukihiro Matsumoto)
2002/06/20
Hi,
[#178] Re: Improving Ruby's garbage collector for interactive apps
— Matthew Bloch <mattbee@...>
2002/06/21
On Thursday 20 June 2002 18:54, you wrote:
[#186] Steps to get multiple interpreters per process... — Sean Chittenden <sean@...>
Can someone chart out what would need to happen to get multiple ruby
10 messages
2002/06/24
[#187] Re: Steps to get multiple interpreters per process...
— matz@... (Yukihiro Matsumoto)
2002/06/25
Hi,
[#188] Re: Steps to get multiple interpreters per process...
— Sean Chittenden <sean@...>
2002/06/25
> |Can someone chart out what would need to happen to get multiple
[#191] Re: Steps to get multiple interpreters per process...
— Chris Ross <chris@...>
2002/06/25
Bignum bug
From:
"Christoph" <chr_news@...>
Date:
2002-06-10 16:14:00 UTC
List:
ruby-core #166
Hi,
the changes 1.43-1.44 and 1.31.2.12 back in
October/November last year created a logical
bug (IMO of course;-). Before this change
---
10**400 > 0.0 # => true
10**400 + 10**400 > 0.0 + 10**400
---
would raise a FloatDomainError, now we are getting
---
10**400 > 0.0 # => true
10**400 + 10**400 > 0.0 + 10**400 # => false
---
in other words ``+'' and ``>'' are in-compatible
(technically you could say that ``>'' is not an
admissible order with respect to ``+'').
/Christoph
--- ruby/bignum.c 2001/10/29 05:07:17 1.43
+++ ruby/bignum.c 2001/10/30 08:43:25 1.44
@@ -3,7 +3,7 @@
bignum.c -
$Author: matz $
- $Date: 2001/10/29 05:07:17 $
+ $Date: 2001/10/30 08:43:25 $
created at: Fri Jun 10 00:48:55 JST 1994
Copyright (C) 1993-2001 Yukihiro Matsumoto
@@ -561,7 +561,13 @@ rb_big_cmp(x, y)
break;
case T_FLOAT:
- y = dbl2big(RFLOAT(y)->value);
+ {
+ double d = rb_big2dbl(x);
+
+ if (d == RFLOAT(y)->value) return INT2FIX(0);
+ if (d > RFLOAT(y)->value) return INT2FIX(1);
+ if (d < RFLOAT(y)->value) return INT2FIX(-1);
+ }
break;
default:
and
diff -u -p -r1.31.2.12 -r1.31.2.13
--- ruby/bignum.c 2001/08/24 06:36:14 1.31.2.12
+++ ruby/bignum.c 2001/10/29 05:04:40 1.31.2.13
@@ -3,7 +3,7 @@
bignum.c -
$Author: matz $
- $Date: 2001/08/24 06:36:14 $
+ $Date: 2001/10/29 05:04:40 $
created at: Fri Jun 10 00:48:55 JST 1994
Copyright (C) 1993-2000 Yukihiro Matsumoto
@@ -591,8 +591,7 @@ rb_big_eq(x, y)
case T_BIGNUM:
break;
case T_FLOAT:
- y = dbl2big(RFLOAT(y)->value);
- break;
+ return (rb_big2dbl(x) == RFLOAT(y)->value)?Qtrue:Qfalse;
default:
return Qfalse;
}