UI for Zipcoin Blue

multipleOf.json 2.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. [
  2. {
  3. "description": "by int",
  4. "schema": {"multipleOf": 2},
  5. "tests": [
  6. {
  7. "description": "int by int",
  8. "data": 10,
  9. "valid": true
  10. },
  11. {
  12. "description": "int by int fail",
  13. "data": 7,
  14. "valid": false
  15. },
  16. {
  17. "description": "ignores non-numbers",
  18. "data": "foo",
  19. "valid": true
  20. }
  21. ]
  22. },
  23. {
  24. "description": "by number",
  25. "schema": {"multipleOf": 1.5},
  26. "tests": [
  27. {
  28. "description": "zero is multiple of anything",
  29. "data": 0,
  30. "valid": true
  31. },
  32. {
  33. "description": "4.5 is multiple of 1.5",
  34. "data": 4.5,
  35. "valid": true
  36. },
  37. {
  38. "description": "35 is not multiple of 1.5",
  39. "data": 35,
  40. "valid": false
  41. }
  42. ]
  43. },
  44. {
  45. "description": "by small number",
  46. "schema": {"multipleOf": 0.0001},
  47. "tests": [
  48. {
  49. "description": "0.0075 is multiple of 0.0001",
  50. "data": 0.0075,
  51. "valid": true
  52. },
  53. {
  54. "description": "0.00751 is not multiple of 0.0001",
  55. "data": 0.00751,
  56. "valid": false
  57. }
  58. ]
  59. },
  60. {
  61. "description": "by decimal number where floating point precision is wrong",
  62. "schema": {"multipleOf": 0.01},
  63. "tests": [
  64. {
  65. "description": "Number 2 is multiple of 0.01",
  66. "data": 2,
  67. "valid": true
  68. },
  69. {
  70. "description": "Number 2.1 is multiple of 0.01",
  71. "data": 2.1,
  72. "valid": true
  73. },
  74. {
  75. "description": "Number 2.2 is multiple of 0.01",
  76. "data": 2.2,
  77. "valid": true
  78. },
  79. {
  80. "description": "Number 2.3 is multiple of 0.01",
  81. "data": 2.3,
  82. "valid": true
  83. },
  84. {
  85. "description": "Number 2.4 is multiple of 0.01",
  86. "data": 2.4,
  87. "valid": true
  88. },
  89. {
  90. "description": "Number 1.211 is not multiple of 0.01",
  91. "data": 1.211,
  92. "valid": false
  93. }
  94. ]
  95. }
  96. ]