Bug 4872 – std.bigint problem with negative numbers

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-09-15T14:10:00Z
Last change time
2010-09-18T20:09:49Z
Assigned to
nobody
Creator
bearophile_hugs
Blocks
4874

Comments

Comment #0 by bearophile_hugs — 2010-09-15T14:10:05Z
With dmd 2.049beta this asserts: import std.bigint: BigInt; void main() { assert(((BigInt(3) * BigInt(-2)) + (BigInt(-5) * BigInt(-1))) == BigInt(-1)); } I think in some situations BigInt(3)*BigInt(-2) == BigInt(6).
Comment #1 by clugdbug — 2010-09-15T15:08:23Z
Fixed svn 2007.