silentmatt/javascript-biginteger — Issue #10: `parse("0b", "16")` and `parse("0c", "16")` are zero
Author: boldt
Created: 2012-03-07 21:58:47+00:00
State: open

A simple program:

```
function print (e) {
var val = BigInteger.parse(e, "16").valueOf();
console.log("HEX(" + e + ") = " + val);
}

console.info("Without prepending zero:")
var arr = ['0','1','2','3','4','5','6','7','8','9','a', 'b', 'c', 'd', 'e', 'f'];
arr.forEach(print);

console.info("With prepending zero:")
var arr2 = ['00','01','02','03','04','05','06','07','08','09','0a', '0b', '0c', '0d', '0e', '0f'];
arr2.forEach(print);
```
It returns:

```
Without prepending zero:
HEX(0) = 0
HEX(1) = 1
HEX(2) = 2
HEX(3) = 3
HEX(4) = 4
HEX(5) = 5
HEX(6) = 6
HEX(7) = 7
HEX(8) = 8
HEX(9) = 9
HEX(a) = 10
HEX(b) = 11
HEX(c) = 12
HEX(d) = 13
HEX(e) = 14
HEX(f) = 15
With prepending zero:
HEX(00) = 0
HEX(01) = 1
HEX(02) = 2
HEX(03) = 3
HEX(04) = 4
HEX(05) = 5
HEX(06) = 6
HEX(07) = 7
HEX(08) = 8
HEX(09) = 9
HEX(0a) = 10
HEX(0b) = 0
HEX(0c) = 0
HEX(0d) = 13
HEX(0e) = 14
HEX(0f) = 15
```

`0a`,`0d` and `0e` are correct, while `0b` and `0c` are zero.

Here the above example (see console): http://paste.dennis-boldt.de/bugs/biginteger/