2016-08-16 12:00:19 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
return [
|
|
|
|
[
|
|
|
|
'178',
|
2017-01-23 05:49:10 +00:00
|
|
|
'10110010',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
[
|
|
|
|
'100',
|
2017-01-23 05:49:10 +00:00
|
|
|
'1100100',
|
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
|
|
|
],
|
|
|
|
[
|
|
|
|
'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
|
|
|
|
[
|
|
|
|
'-107',
|
2017-01-23 05:49:10 +00:00
|
|
|
'1110010101',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
// 2's Complement
|
|
|
|
[
|
|
|
|
'-1',
|
2017-01-23 05:49:10 +00:00
|
|
|
'1111111111',
|
2016-08-16 12:00:19 +00:00
|
|
|
],
|
|
|
|
];
|