2012-03-23 18:04:58 +00:00
|
|
|
357, "101100101"
|
Fix unit tests for all base conversion functions
This include cases were artificial constraints were not checked
(eg: between -512 and 511 for `DECBIN`) and some bugs were 32
bits platform were assumed.
The following are covered:
`BIN2DEC`, `BIN2HEX`, `BIN2OCT`,
`DEC2BIN`, `DEC2HEX`, `DEC2OCT`,
`HEX2BIN`, `HEX2DEC`, `HEX2OCT`,
`OCT2BIN`, `OCT2DEC`, `OCT2HEX`
2016-07-31 17:42:58 +00:00
|
|
|
512, "#NUM!" // Too large
|
|
|
|
-513, "#NUM!" // Too small
|
2012-03-23 18:04:58 +00:00
|
|
|
9, 4, "1001"
|
|
|
|
9, 8, "00001001"
|
|
|
|
9, 6.75, "001001" // Leading places as a float
|
|
|
|
9, -1, "#NUM!" // Leading places negative
|
|
|
|
9, "ABC", "#VALUE!" // Leading places non-numeric
|
|
|
|
246, "11110110"
|
|
|
|
12345, "#NUM!"
|
|
|
|
123456789, "#NUM!"
|
|
|
|
123.45, "1111011"
|
|
|
|
0, "0"
|
|
|
|
"3579A", "#VALUE!" // Invalid decimal
|
|
|
|
TRUE, "#VALUE!" // Non string
|
|
|
|
-100, "1110011100" // 2's Complement
|
|
|
|
-107, "1110010101" // 2's Complement
|
Fix unit tests for all base conversion functions
This include cases were artificial constraints were not checked
(eg: between -512 and 511 for `DECBIN`) and some bugs were 32
bits platform were assumed.
The following are covered:
`BIN2DEC`, `BIN2HEX`, `BIN2OCT`,
`DEC2BIN`, `DEC2HEX`, `DEC2OCT`,
`HEX2BIN`, `HEX2DEC`, `HEX2OCT`,
`OCT2BIN`, `OCT2DEC`, `OCT2HEX`
2016-07-31 17:42:58 +00:00
|
|
|
-512, "1000000000" // 2's Complement
|