# json.stringify: properly implement RFC8259 recommendation · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/1cce539ddcba1e21615e11dcf75f011074942414)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 1cce539ddcba1e21615e11dcf75f011074942414

Requested commit: 1cce539ddcba1e21615e11dcf75f011074942414

Commit: 1cce539ddcba1e21615e11dcf75f011074942414

Tree: 2e7b979cbfcf9b7c3597f5094184a0bdcdf27214

Author: Jacob Young

Committer: Jacob Young

## Message

```
json.stringify: properly implement RFC8259 recommendation

The previous magic numbers used `1 << 52`, which did not account for the
implicit leading one in the floating point format.  The RFC is correct
when it uses an exponent of 53.  Technically these exclusive endpoints
are also representable, but everyone including the RFC seems to use them
exclusively.

Also, delete special case optimizations related to the type which have
already been implemented in the zig compiler to produce comptime values
for tautological runtime comparisons.

```

## Parents

- [7dacf7774523a454fce7216c13eb03c6badf8d7b](https://git.cafe/gitcafe/zig/commit/7dacf7774523a454fce7216c13eb03c6badf8d7b?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/1cce539ddcba1e21615e11dcf75f011074942414?format=markdown)
