[Issue 5654] New: BigInt returns ZERO with strings of single digit number with leading zeros

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 25 21:50:06 PST 2011


http://d.puremagic.com/issues/show_bug.cgi?id=5654

           Summary: BigInt returns ZERO with strings of single digit
                    number with leading zeros
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody at puremagic.com
        ReportedBy: yangbak at gmail.com


--- Comment #0 from Yang <yangbak at gmail.com> 2011-02-25 21:47:20 PST ---
import std.stdio;
import std.bigint;

void main()
{
  BigInt a = "01";
  writeln(a);
  BigInt b = "007";
  writeln(b);
  BigInt c = "+0009";
  writeln(c);
  BigInt d = "1";
  writeln(d);
  BigInt e = 001;
  writeln(e);
}
Output
  0
  0
  0
  1 -> Ok
  1 -> Ok

// Is this related to the function fromDecimalString() from biguintcore.d??

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list