BIN2OCT.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. return [
  3. ['144', 1100100],
  4. ['262', '10110010'],
  5. ['#NUM!', '111001010101'], // Too large
  6. ['011', '1001, 3'], // Leading places
  7. ['0011', '1001, 4.75'], // Leading places as a float
  8. ['#NUM!', '1001, -1'], // Leading places negative
  9. ['#VALUE!', '1001, "ABC"'], // Leading places non-numeric
  10. ['2', '00000010'],
  11. ['5', '00000101'],
  12. ['15', '00001101'],
  13. ['0', '0'],
  14. ['#NUM!', '21'], // Invalid binary number
  15. ['#VALUE!', 'true'], // Boolean okay for ODS, not for others
  16. ['#VALUE!', 'false'], // Boolean okay for ODS, not for others
  17. ['7777777625', '1110010101'], // 2's Complement
  18. ['7777777777', '1111111111'], // 2's Complement
  19. ['7777777000', '1000000000'], // lowest negative
  20. ['777', '111111111'], // highest positive
  21. ['0', '0000000000'],
  22. ['1', '000000001'],
  23. ['400', '0100000000'],
  24. ['400', '100000000'],
  25. ['7777777400', '1100000000'],
  26. ['0003', '11, 4'],
  27. ['#NUM!', '11, 0'],
  28. ['#NUM!', '11, -1'],
  29. ['#NUM!', '11, 14'],
  30. ['#NUM!', '10001, 1'],
  31. ['21', '10001, 2'],
  32. [5, 'A2'],
  33. ['#NUM!', '"A2"'],
  34. [0, 'A3'],
  35. ['exception', ''],
  36. ];