2016-08-16 12:00:19 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
return [
|
|
|
|
[
|
|
|
|
'B2',
|
2017-01-23 05:49:10 +00:00
|
|
|
'10110010',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
// Too large
|
|
|
|
[
|
|
|
|
'#NUM!',
|
2017-01-23 05:49:10 +00:00
|
|
|
'111001010101',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
// Leading places
|
|
|
|
[
|
2017-01-23 05:49:10 +00:00
|
|
|
'00FB',
|
2016-08-16 12:00:19 +00:00
|
|
|
'11111011',
|
|
|
|
4,
|
|
|
|
],
|
|
|
|
// Leading places as a float
|
|
|
|
[
|
2017-01-23 05:49:10 +00:00
|
|
|
'0FB',
|
2016-08-16 12:00:19 +00:00
|
|
|
'11111011',
|
|
|
|
3.75,
|
|
|
|
],
|
|
|
|
// Leading places negative
|
|
|
|
[
|
2017-01-23 05:49:10 +00:00
|
|
|
'#NUM!',
|
2016-08-16 12:00:19 +00:00
|
|
|
'11111011',
|
|
|
|
-1,
|
|
|
|
],
|
|
|
|
// Leading places non-numeric
|
|
|
|
[
|
2017-01-23 05:49:10 +00:00
|
|
|
'#VALUE!',
|
2016-08-16 12:00:19 +00:00
|
|
|
'11111011',
|
|
|
|
'ABC',
|
|
|
|
],
|
|
|
|
[
|
|
|
|
'E',
|
2017-01-23 05:49:10 +00:00
|
|
|
'1110',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'5',
|
2017-01-23 05:49:10 +00:00
|
|
|
'101',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'2',
|
2017-01-23 05:49:10 +00:00
|
|
|
'10',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'0',
|
|
|
|
'0',
|
|
|
|
],
|
|
|
|
// Invalid binary number
|
|
|
|
[
|
|
|
|
'#NUM!',
|
2017-01-23 05:49:10 +00:00
|
|
|
'21',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
// Non string
|
|
|
|
[
|
|
|
|
'#VALUE!',
|
2017-01-23 05:49:10 +00:00
|
|
|
true,
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
// 2's Complement
|
|
|
|
[
|
|
|
|
'FFFFFFFF95',
|
2017-01-23 05:49:10 +00:00
|
|
|
'1110010101',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
// 2's Complement
|
|
|
|
[
|
|
|
|
'FFFFFFFFFF',
|
2017-01-23 05:49:10 +00:00
|
|
|
'1111111111',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
];
|