float.test 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. Different float syntaxes
  2. -----
  3. <?php
  4. 0.0;
  5. 0.;
  6. .0;
  7. 0e0;
  8. 0E0;
  9. 0e+0;
  10. 0e-0;
  11. 30.20e10;
  12. 300.200e100;
  13. 1e10000;
  14. // various integer -> float overflows
  15. // (all are actually the same number, just in different representations)
  16. 18446744073709551615;
  17. 0xFFFFFFFFFFFFFFFF;
  18. 01777777777777777777777;
  19. 0177777777777777777777787;
  20. 0b1111111111111111111111111111111111111111111111111111111111111111;
  21. -----
  22. array(
  23. 0: Scalar_DNumber(
  24. value: 0
  25. )
  26. 1: Scalar_DNumber(
  27. value: 0
  28. )
  29. 2: Scalar_DNumber(
  30. value: 0
  31. )
  32. 3: Scalar_DNumber(
  33. value: 0
  34. )
  35. 4: Scalar_DNumber(
  36. value: 0
  37. )
  38. 5: Scalar_DNumber(
  39. value: 0
  40. )
  41. 6: Scalar_DNumber(
  42. value: 0
  43. )
  44. 7: Scalar_DNumber(
  45. value: 302000000000
  46. )
  47. 8: Scalar_DNumber(
  48. value: 3.002E+102
  49. )
  50. 9: Scalar_DNumber(
  51. value: INF
  52. )
  53. 10: Scalar_DNumber(
  54. value: 1.844674407371E+19
  55. comments: array(
  56. 0: // various integer -> float overflows
  57. 1: // (all are actually the same number, just in different representations)
  58. )
  59. )
  60. 11: Scalar_DNumber(
  61. value: 1.844674407371E+19
  62. )
  63. 12: Scalar_DNumber(
  64. value: 1.844674407371E+19
  65. )
  66. 13: Scalar_DNumber(
  67. value: 1.844674407371E+19
  68. )
  69. 14: Scalar_DNumber(
  70. value: 1.844674407371E+19
  71. )
  72. )