[ruby-core:65325] [ruby-trunk - Bug #10306] BigNum error

From: t_nissie@...
Date: 2014-09-30 02:30:20 UTC
List: ruby-core #65325
Issue #10306 has been updated by Takeshi Nishimatsu.


On Darwin (Mac OS X), I made miniruby with /usr/bin/cc and /usr/local/bin/gcc (gcc-4.8.2 installed by myself).
I got the same correct results with both minirubys:

```
$ /usr/bin/cc --version
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.3.0
Thread model: posix
$ /usr/local/bin/gcc --version
gcc (GCC) 4.8.2
Copyright (C) 2013 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ ./miniruby -v -e 'p (1000000000 ** 99).to_s.count("0")'
ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin13.0]
891
```


----------------------------------------
Bug #10306: BigNum error
https://bugs.ruby-lang.org/issues/10306#change-49141

* Author: Max Bacoux
* Status: Open
* Priority: Normal
* Assignee: 
* Category: core
* Target version: 
* ruby -v: ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin13.0]
* Backport: 2.0.0: UNKNOWN, 2.1: UNKNOWN
----------------------------------------
Some calculations are wrong when dealing with large bignums.

For example, try 1000000000 ** 99, the result is obviously not right.



-- 
https://bugs.ruby-lang.org/

In This Thread

Prev Next