Re:Amazon open-sources Ion – a binary and text interchangabl...
by justin_oaks on Friday April 22, 2016 @01:13AM
(#11547191)
Do you really need those extra 11 bits? Javascript numbers accurately represent integers up to 2^53 - 1. See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
[ Parent
| on HN ]
Re:Amazon open-sources Ion – a binary and text interchangabl...
by snuxoll on Friday April 22, 2016 @01:25AM
(#11547226)
Until you need to deal with decimals instead of floats, then you are going to hate yourself because you have to pull in some third party library because the language treats every single number as a float (and floating point errors are a lot more common than most people think even when they are adding together simple numbers).
Re:Amazon open-sources Ion – a binary and text interchangabl...
by Dylan16807 on Friday April 22, 2016 @02:39AM
(#11547436)
Integers will do no better at pretending to be a decimal type without a library.
Re:Amazon open-sources Ion – a binary and text interchangabl...
by snuxoll on Friday April 22, 2016 @11:39AM
(#11549981)
Sure, but most other languages have built-in support for decimal types. Java has BigDecimal, as does Ruby, Python has the decimal module, C# has System.Decimal, the list goes on.
Javascript doesn't even have proper integers to guarantee the functioning of this correctly, it's a really sad state.
Re:Amazon open-sources Ion – a binary and text interchangabl...
by Dylan16807 on Friday April 22, 2016 @12:04PM
(#11550166)
>Javascript doesn't even have proper integers to guarantee the functioning of this correctly
I don't understand what you mean at all. Javascript should be able support a decimal library just as easily as a language with integers.
Re:Amazon open-sources Ion – a binary and text interchangabl...
by Cshelton on Friday April 22, 2016 @01:21AM
(#11547219)
I just did some ownership percentage stuff where it's not uncommon to go 16 decimal places out...working with JavaScript on this was a pain. Never thought I'd care about that .00000000000001 difference hah...
Re:Amazon open-sources Ion – a binary and text interchangabl...
by tlarkworthy on Friday April 22, 2016 @02:25AM
(#11547396)
floating point works best near 0, most of the numbers it can represent lie near 0 (negative exponent is a number less than 1).