BITLSHIFT.php 982 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. return [
  3. [96, '3, 5'],
  4. [36, '9, "2"'],
  5. ['#VALUE!', '"ABC", 5'],
  6. ['#VALUE!', '5, "ABC"'],
  7. ['#NUM!', '1, 48'], // result too large
  8. ['#NUM!', '1.1, 2'], // first arg must be integer
  9. [4, '1, 2.1'], // second arg will be truncated
  10. ['#NUM!', '0, 54'], // second arg too large
  11. [0, '0, 5'],
  12. ['#NUM!', '-16, 2'], // first arg can't be negative
  13. [1, '4, -2'], // negative shift permitted
  14. [1, '4, -2.1'], // negative shift and (ignored) fraction permitted
  15. [4, '"4", Q15'],
  16. [4, '4, null'],
  17. [4, '4, false'],
  18. [8, '4, true'],
  19. ['exception', ''],
  20. ['exception', '2'],
  21. [0, ', 4'],
  22. [0, 'Q15, 4'],
  23. [4, '4, q15'],
  24. [4, '4, false'],
  25. [8, '4, true'],
  26. [0, 'false, 4'],
  27. [16, 'true, 4'],
  28. [16, 'A2, 1'],
  29. [8000000000, '1000000000, 3'], // result > 2**32
  30. [16000000000, '8000000000, 1'], // argument > 2**32
  31. ['#NUM!', 'power(2,50), 1'], // argument >= 2**48
  32. ['1', 'power(2, 47), -47'],
  33. ];