Thread overview | ||||||
---|---|---|---|---|---|---|
|
October 16, 2011 [Issue 6819] New: BigInt ^^ fails for some big numbers (powers) | ||||
---|---|---|---|---|
| ||||
http://d.puremagic.com/issues/show_bug.cgi?id=6819 Summary: BigInt ^^ fails for some big numbers (powers) Product: D Version: D2 Platform: x86_64 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nobody@puremagic.com ReportedBy: redhatbugzilla@yopmail.com --- Comment #0 from Olivier Fabre <redhatbugzilla@yopmail.com> 2011-10-16 16:16:40 PDT --- With dmd 2.055 under Linux x86-64, (BigInt(10)^^p)^^2 doesn't return the correct result starting from p == 32: import std.stdio, std.bigint; void main() { for( int p = 0 ; p < 40 ; p++ ) { BigInt n = BigInt(10)^^p; BigInt a = n*n; BigInt b = n^^2; if( a != b ) { writefln( "%s %s %s %s", p, n, a, b ); } } } It also fails with BigInt(2)^^p (from p==32 too) and BigInt(20)^^p (from p==16). Values like (BigInt(2)^^32+1)^^2 are computed correctly. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 17, 2011 [Issue 6819] BigInt ^^ fails for some big numbers (powers) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Olivier Fabre | http://d.puremagic.com/issues/show_bug.cgi?id=6819 Don <clugdbug@yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |clugdbug@yahoo.com.au OS/Version|Linux |All Severity|normal |critical --- Comment #1 from Don <clugdbug@yahoo.com.au> 2011-10-16 22:54:46 PDT --- Ouch. There's a shift by 32 missing. Looks like a fencepost error. Raising to critical. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 21, 2011 [Issue 6819] BigInt ^^ fails for some big numbers (powers) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Olivier Fabre | http://d.puremagic.com/issues/show_bug.cgi?id=6819 Don <clugdbug@yahoo.com.au> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED --- Comment #2 from Don <clugdbug@yahoo.com.au> 2011-10-20 23:55:35 PDT --- https://github.com/D-Programming-Language/phobos/commit/1d3a9d22766a3dbcb0063ef907f3e0dd32382a6d -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
October 21, 2011 [Issue 6819] BigInt ^^ fails for some big numbers (powers) | ||||
---|---|---|---|---|
| ||||
Posted in reply to Olivier Fabre | http://d.puremagic.com/issues/show_bug.cgi?id=6819 --- Comment #3 from Olivier Fabre <redhatbugzilla@yopmail.com> 2011-10-21 05:29:20 PDT --- (In reply to comment #2) I've just built and tried latest git (dmd2+druntime+libphobos2) and both the small test above and my original program that triggered the bug now work correctly. Thanks! -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- |
Copyright © 1999-2021 by the D Language Foundation