Compliance cases
These are the 2,018 inputs a submission must format. Each output must match the expected text byte for byte. You can run the suite without reading it, or open any case to see its input and expected output.
The shortest decimal digits that round back to the value, the closest of them when several do, and the even one of an exact tie, laid out as ECMA-262 says: plain notation from 1e-6 up to 1e21, exponent notation such as 1e+21 and 1e-7 outside it. This is Ryū, Grisu, Schubfach or Dragonbox territory. The compliance suite has 59,086 values: every sample in RFC 8785 Appendix B, every value in Ryū's tests, 20,000 of the doubles in Gay's shortest-digit table, every power of two, the doubles at and around every power of ten, both ends of every binary exponent, every layout from n = -9 to 24, hundreds of exact ties, hundreds of values beside a decimal exactly halfway between two doubles, subnormals, and seeded random values. Exact rational arithmetic, Python's repr and V8 agree on every answer.
Run the full compliance suite locally. Replace your-component.wasm
with your compiled component.
Download the suite
curl -fLo format_f64_rfc8785.comply.wasm https://calculated.world/comply/format_f64_rfc8785.wasm
npx qipok your-component.wasm --suite format_f64_rfc8785.comply.wasm
42 of 2,018 cases
| Case | Name | Expected | Note | Size |
|---|---|---|---|---|
| 000065 | ryu/MinMaxShift/1.7800590868057611E-307 Ryū’s tests |
1.7800590868057611e-307␊
|
1 value | |
| 000066 | ryu/MinMaxShift/2.8480945388892175E-306 Ryū’s tests |
2.8480945388892175e-306␊
|
1 value | |
| 000067 | ryu/MinMaxShift/2.446494580089078E-296 Ryū’s tests |
2.446494580089078e-296␊
|
1 value | |
| 000068 | ryu/MinMaxShift/4.8929891601781557E-296 Ryū’s tests |
4.8929891601781557e-296␊
|
1 value | |
| 000069 | ryu/MinMaxShift/1.8014398509481984E16 Ryū’s tests |
18014398509481984␊
|
1 value | |
| 000070 | ryu/MinMaxShift/3.6028797018963964E16 Ryū’s tests |
36028797018963964␊
|
1 value | |
| 000071 | ryu/MinMaxShift/2.900835519859558E-216 Ryū’s tests |
2.900835519859558e-216␊
|
1 value | |
| 000072 | ryu/MinMaxShift/5.801671039719115E-216 Ryū’s tests |
5.801671039719115e-216␊
|
1 value | |
| 000073 | ryu/MinMaxShift/3.196104012172126E-27 Ryū’s tests |
3.196104012172126e-27␊
|
1 value | |
| 000074 | ryu/MinMaxShift/all Ryū’s tests |
1.7800590868057611e-307␊2.8480945388892175e-306␊…
|
9 values | |
| 000277 | regression/exponent edge/1 to 64 Focused regression |
2.225073858507202e-308␊4.4501477170144023e-308␊4…
|
192 values | |
| 000278 | regression/exponent edge/65 to 128 Focused regression |
4.104536801298377e-289␊8.209073602596752e-289␊8.…
|
192 values | |
| 000279 | regression/exponent edge/129 to 192 Focused regression |
7.57153399146736e-270␊1.5143067982934715e-269␊1.…
|
192 values | |
| 000280 | regression/exponent edge/193 to 256 Focused regression |
1.3967014978599095e-250␊2.793402995719818e-250␊2…
|
192 values | |
| 000281 | regression/exponent edge/257 to 320 Focused regression |
2.576459507838854e-231␊5.152919015677706e-231␊5.…
|
192 values | |
| 000282 | regression/exponent edge/321 to 384 Focused regression |
4.752728915737901e-212␊9.505457831475798e-212␊9.…
|
192 values | |
| 000283 | regression/exponent edge/385 to 448 Focused regression |
8.767237396033614e-193␊1.7534474792067222e-192␊1…
|
192 values | |
| 000284 | regression/exponent edge/449 to 512 Focused regression |
1.6172698447808783e-173␊3.2345396895617556e-173␊…
|
192 values | |
| 000285 | regression/exponent edge/513 to 576 Focused regression |
2.9833362924800834e-154␊5.966672584960165e-154␊5…
|
192 values | |
| 000286 | regression/exponent edge/577 to 640 Focused regression |
5.50328410731896e-135␊1.1006568214637917e-134␊1.…
|
192 values | |
| 000287 | regression/exponent edge/641 to 704 Focused regression |
1.01517673492626e-115␊2.0303534698525192e-115␊2.…
|
192 values | |
| 000288 | regression/exponent edge/705 to 768 Focused regression |
1.8726705418768797e-96␊3.7453410837537582e-96␊3.…
|
192 values | |
| 000289 | regression/exponent edge/769 to 832 Focused regression |
3.454467422037779e-77␊6.908934844075555e-77␊6.90…
|
192 values | |
| 000290 | regression/exponent edge/833 to 896 Focused regression |
6.37236764452981e-58␊1.2744735289059617e-57␊1.27…
|
192 values | |
| 000291 | regression/exponent edge/897 to 960 Focused regression |
1.1754943508222878e-38␊2.3509887016445748e-38␊2.…
|
192 values | |
| 000292 | regression/exponent edge/961 to 1024 Focused regression |
2.1684043449710093e-19␊4.3368086899420173e-19␊4.…
|
192 values | |
| 000293 | regression/exponent edge/1025 to 1088 Focused regression |
4.000000000000001␊7.999999999999999␊7.9999999999…
|
192 values | |
| 000294 | regression/exponent edge/1089 to 1152 Focused regression |
73786976294838220000␊147573952589676400000␊14757…
|
192 values | |
| 000295 | regression/exponent edge/1153 to 1216 Focused regression |
1.3611294676837542e+39␊2.7222589353675074e+39␊2.…
|
192 values | |
| 000296 | regression/exponent edge/1217 to 1280 Focused regression |
2.510840694154673e+58␊5.021681388309344e+58␊5.02…
|
192 values | |
| 000297 | regression/exponent edge/1281 to 1344 Focused regression |
4.631683569492649e+77␊9.263367138985295e+77␊9.26…
|
192 values | |
| 000298 | regression/exponent edge/1345 to 1408 Focused regression |
8.543948143683642e+96␊1.7087896287367279e+97␊1.7…
|
192 values | |
| 000299 | regression/exponent edge/1409 to 1472 Focused regression |
1.5760802478557795e+116␊3.152160495711558e+116␊3…
|
192 values | |
| 000300 | regression/exponent edge/1473 to 1536 Focused regression |
2.907354897182428e+135␊5.8147097943648545e+135␊5…
|
192 values | |
| 000301 | regression/exponent edge/1537 to 1600 Focused regression |
5.36312317197704e+154␊1.0726246343954076e+155␊1.…
|
192 values | |
| 000302 | regression/exponent edge/1601 to 1664 Focused regression |
9.893216058924184e+173␊1.978643211784836e+174␊1.…
|
192 values | |
| 000303 | regression/exponent edge/1665 to 1728 Focused regression |
1.8249762470488785e+193␊3.6499524940977558e+193␊…
|
192 values | |
| 000304 | regression/exponent edge/1729 to 1792 Focused regression |
3.36648697699096e+212␊6.732973953981917e+212␊6.7…
|
192 values | |
| 000305 | regression/exponent edge/1793 to 1856 Focused regression |
6.210072369202837e+231␊1.242014473840567e+232␊1.…
|
192 values | |
| 000306 | regression/exponent edge/1857 to 1920 Focused regression |
1.1455561567389987e+251␊2.2911123134779966e+251␊…
|
192 values | |
| 000307 | regression/exponent edge/1921 to 1984 Focused regression |
2.1131781245426615e+270␊4.2263562490853215e+270␊…
|
192 values | |
| 000308 | regression/exponent edge/1985 to 2046 Focused regression |
3.8981256045600005e+289␊7.796251209119998e+289␊7…
|
186 values |
Where these rules come from
RFC 8785 §3.2.2.3
serializes every JSON number as ECMAScript does, by
ECMA-262’s Number::toString
: the shortest digits that round back, the closest of those, and the even one
of an exact tie, laid out in plain or exponent notation by the decimal exponent.
Every answer is agreed by exact rational arithmetic and Python’s repr;
the suite’s own tests add V8’s Number.prototype.toString
and JSON.stringify, and the app’s tests add Erlang’s shortest formatting.
Of the 59,086 values, 521 are ties.
- RFC 8785 Appendix B — the RFC’s number serialization samples, the source of the 25 rfc8785 cases
- Ryū’s d2s tests — Ulf Adams’s test values, from his paper Ryū: fast float-to-string conversion
- double-conversion’s gay-shortest.cc — 100,000 random doubles with the digits David Gay’s dtoa gives; every one is checked, and every fifth is in the 200 gay cases