Commit 1fc82df
authored
docs: record the JSON type a numeric attribute takes on each read path
A reader that decodes a chain response through @wharfkit/antelope and a
reader that calls a hosted API receive different JSON types for the same
stored value, and nothing in the corpus said so. In the raw get_table_rows
body nodeos prints every float as a quoted decimal string of the widened
double, the client library follows that convention, and the hosted APIs
answer a number, except on values that reached the database through the ABI
action path, where the indexer objectified the string form and stored it.
The float32 half of that convention loses information: toFixed(7) keeps
seven decimal places where a float32 carries about seven significant digits,
so a value needing more than seven fractional decimals cannot be read back,
and the two float32 values one and two units above 0.5 print alike. A short
decimal literal survives, which is why the measured failure rates are stated
as sample rates rather than as bounds on a decade.
Every claim is cited to a live read or to the library source. The path rule
comes from four responses rather than from indexer source, which the ledger
row states, as does the discrepancy between the SDK page's declared numeric
widths and the quoted decimal a raw table read answers.1 parent 880dec0 commit 1fc82df
7 files changed
Lines changed: 98 additions & 6 deletions
File tree
- reference
- atomicassets
- sdk
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
37 | 38 | | |
38 | 39 | | |
39 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
5 | 14 | | |
6 | 15 | | |
7 | 16 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
| 44 | + | |
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
71 | | - | |
| 71 | + | |
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| |||
0 commit comments