-
-
Notifications
You must be signed in to change notification settings - Fork 215
/
Copy pathbignum.json
192 lines (192 loc) · 6.44 KB
/
bignum.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
[
{
"description": "integer",
"schema": { "type": "integer" },
"tests": [
{
"description": "a bignum is an integer",
"data": 12345678910111213141516171819202122232425262728293031,
"valid": true
},
{
"description": "a negative bignum is an integer",
"data": -12345678910111213141516171819202122232425262728293031,
"valid": true
},
{
"description": "a bignum is an integer if it has a zero fractional component",
"data": 12345678910111213141516171819202122232425262728293031.0,
"valid": true
},
{
"description": "a negative bignum is an integer if it has a zero fractional component",
"data": -12345678910111213141516171819202122232425262728293031.0,
"valid": true
}
]
},
{
"description": "number",
"schema": { "type": "number" },
"tests": [
{
"description": "a bignum is a number",
"data": 98249283749234923498293171823948729348710298301928331,
"valid": true
},
{
"description": "a negative bignum is a number",
"data": -98249283749234923498293171823948729348710298301928331,
"valid": true
},
{
"description": "a bignum with a zero fractional component is a number",
"data": 98249283749234923498293171823948729348710298301928331.0,
"valid": true
},
{
"description": "a negative bignum with a zero fractional component is a number",
"data": -98249283749234923498293171823948729348710298301928331.0,
"valid": true
}
]
},
{
"description": "string",
"schema": { "type": "string" },
"tests": [
{
"description": "a bignum is not a string",
"data": 98249283749234923498293171823948729348710298301928331,
"valid": false
},
{
"description": "a bignum with zero fractional component is not a string",
"data": 98249283749234923498293171823948729348710298301928331.0,
"valid": false
},
{
"description": "a float bignum is not a string",
"data": 98249283749234923498293171823948729348710298301928331.1,
"valid": false
}
]
},
{
"description": "integer comparison, very large number",
"schema": { "maximum": 18446744073709551615 },
"tests": [
{
"description": "comparison works for high integer numbers",
"data": 18446744073709551600,
"valid": true
},
{
"description": "comparison works for high integer floats",
"data": 18446744073709551600.0,
"valid": true
},
{
"description": "comparison works for high non-integer floats",
"data": 18446744073709551600.1,
"valid": true
}
]
},
{
"description": "float comparison with high precision on positive numbers",
"schema": {
"exclusiveMaximum": 972783798187987123879878123.18878137
},
"tests": [
{
"description": "comparison works for high integers",
"data": 972783798187987123879878123,
"valid": false
},
{
"description": "comparison works for high float integers",
"data": 972783798187987123879878124.0,
"valid": false
},
{
"description": "comparison works for high non-integer numbers",
"data": 972783798187987123879878123.188781371,
"valid": false
}
]
},
{
"description": "integer comparison, very low number",
"schema": { "minimum": -18446744073709551615 },
"tests": [
{
"description": "comparison works for very negative integers",
"data": -18446744073709551600,
"valid": true
},
{
"description": "comparison works for very negative float integers",
"data": -18446744073709551600.0,
"valid": true
},
{
"description": "comparison works for very negative non-integer numbers",
"data": -18446744073709551600.1,
"valid": true
}
]
},
{
"description": "float comparison with high precision on negative numbers",
"schema": {
"exclusiveMinimum": -972783798187987123879878123.18878137
},
"tests": [
{
"description": "comparison works for very negative integers",
"data": -972783798187987123879878124,
"valid": false
},
{
"description": "comparison works for very negative float integers",
"data": -972783798187987123879878124.0,
"valid": false
},
{
"description": "comparison works for very negative float non-integers",
"data": -972783798187987123879878123.18878137,
"valid": false
}
]
},
{
"description": "multipleOf with a very large dividend",
"schema": {
"multipleOf": 0.123456789
},
"tests": [
{
"description": "true result",
"data": 1.23456789e+307,
"valid": true
},
{
"description": "false result",
"data": 1e308,
"valid": false
}
]
},
{
"description": "all integers are multiples of 0.5, if overflow is handled",
"schema": { "multipleOf": 0.5 },
"tests": [
{
"description": "valid if optional overflow handling is implemented",
"data": 1e308,
"valid": true
}
]
}
]