4 ms·
I recently discovered 'posits' which are clearly the best number format for representing rationals (don't say 'real', we can exactly represent approximately 0%
by infogulch 4y ago
I recently discovered 'posits' which are clearly the best number format for representing rationals (don't say 'real', we can exactly represent approximately 0% of the reals).
- zelphirkalt 4y agoSo what makes posits so great?
- infogulch 4y agoNo infinities, it saturates instead. Only one bit pattern for 'NaR'. Only one bit pattern for 0. No subnormals. No overflow or underflow. Highest resolution around 0. Natural graceful degredation in resolution for larger numbers. A much higher percentage of hitting an exactly representable result over all operations. Equality and ordinal comparison is the same as for integers. Much simpler addition and multiplication. -1/x is just twos complement. Perfect reciprocals of powers of 2. 1 clock sigmoid function. A very clean conceptual design. https://youtu.be/JJgT-YphE1Y https://youtu.be/JJgT-YphE1Y
- wruza 4y agoAlso prohibits nan-boxing, afaiu, which may be a big loss for dynamic languages.
- nerdponx 4y agoWhat does NaN-boxing mean in this context?
- wruza 4y agohttps://softwareengineering.stackexchange.com/a/185431 https://softwareengineering.stackexchange.com/a/185431 Basically it is a way to push primitive values of any type and pointers into a 64-bit double, to reduce memory/cache footprint in dynamic languages.
- _0ffh 4y agoI think the advantages are big enough that you can afford to use a flag plus a 63 bit posit and still be ahead.
- dmoreno 4y agoFor reference, as I didn't know, posits are a modern float number alternative to IEEE 754. Wikipedia[1] claims better in many aspects, but, as ubiquitous as IEEE numbers are I don't see them getting replaced soon. [1] https://en.m.wikipedia.org/wiki/Unum_(number_format)#Unum_III https://en.m.wikipedia.org/wiki/Unum_(number_format)#Unum_II...