News for hackers. Stuff that matters.
Re:MessagePack: like JSON, but fast and small by mark-r on Tuesday March 10, 2020 @03:45PM (#22538859)
> Also for completeness it would be better to differentiate between int and float as float is imprecise due to rounding errors.

Not true for most numbers. A 64-bit IEEE float can handle any 53-bit integer with no error at all.

Re:MessagePack: like JSON, but fast and small by zeroimpl on Tuesday March 10, 2020 @05:25PM (#22539880)
It can represent less than 0.1% of all 64-bit ints. That doesn’t seem like most to me.
Re:MessagePack: like JSON, but fast and small by mark-r on Tuesday March 10, 2020 @05:33PM (#22539964)
I didn't claim 64-bit ints, I claimed 53-bit ints. How often do you use ints in the range from 54 to 64 bits? I'm willing to bet it's close to never. That's what I meant by "most". You have to consider the distribution.
Re:MessagePack: like JSON, but fast and small by ben0x539 on Wednesday March 11, 2020 @04:17AM (#22544065)
randomly generated IDs as 64 bit ints, pretty often. I mean, tweet IDs are up there too.
Re:MessagePack: like JSON, but fast and small by ben0x539 on Wednesday March 11, 2020 @12:11AM (#22542915)
Almost all numbers aren't 53-bit integers (or smaller) :P
Re:MessagePack: like JSON, but fast and small by mark-r on Wednesday March 11, 2020 @11:44AM (#22546724)
Since everybody feels like getting all pedantic on me, let me clarify what I was trying to say. Most of the integers you encounter in real life will be 53 bits or less, and can be held in an IEEE-754 64-bit float without introducing any error. It is not worth introducing a separate integer type for the exceptions, particularly when the language used as the basis of the format (Javascript) does not have an integer type.