Bug 5608 – BigInt(1)-1 problem

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2011-02-18T03:18:00Z
Last change time
2011-02-23T15:12:21Z
Keywords
wrong-code
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2011-02-18T03:18:46Z
This program prints "-0" and then the assert fires, dmd 2.052: import std.stdio, std.bigint; void main() { writeln(BigInt(1)-1); assert((BigInt(1)-1) == 0); } Output: -0
Comment #1 by clugdbug — 2011-02-23T13:36:54Z
Comment #2 by bearophile_hugs — 2011-02-23T15:12:21Z
Thank you Don.