4 ms·
This is an artifact of JavaScript, which even as of ES6 uses IEEE 754 double-precision floats for all numeric values. jq likely uses the same implementation in
by otterley 8y ago
This is an artifact of JavaScript, which even as of ES6 uses IEEE 754 double-precision floats for all numeric values. jq likely uses the same implementation internally for compatibility reasons and to avoid surprises of a different kind.
See https://www.ecma-international.org/ecma-262/6.0/#sec-ecmascript-language-types-number-type https://www.ecma-international.org/ecma-262/6.0/#sec-ecmascr...
- int0x80 8y agoI think an 'error out if overflow/truncation'-mode available as a command line flag could be useful if you just don't have any JS involved in the JSON pipeline.
- BrendanEich 8y agoBigInt in top browsers now, not under a flag. Just sayin'! https://brendaneich.com/wp-content/uploads/2017/12/dotJS-2017.pdf#page=21&zoom=auto,-177,1061 https://brendaneich.com/wp-content/uploads/2017/12/dotJS-201... et seq.