One place where I'd like to see this used is with the JSON parser... the current JSON parser can't represent all numbers, it's a potentially lossy transformation from JSON numbers to binary floats... although Javascript only has the equivalent of Float64 for all numbers, the good JSON parsers that I've seen have the option of using something like Python's Decimal or Java's BigDecimal). This would get us part of the way there... you do really need to use BigInt and an arbitrary precision decimal floating point type to correctly handle all numbers without losing information (this is why I'd also like to see a wrapper for the decNumber package, it supports all 6 fixed with formats, an arbitrary precision format, it supports many more platforms such as IBM's Power, and might even be usable for ARM builds).
Great stuff! On Tuesday, April 28, 2015 at 9:26:17 PM UTC-4, Steven G. Johnson wrote: > > The DecFP package > > https://github.com/stevengj/DecFP.jl > > provides 32-bit, 64-bit, and 128-bit binary-encoded decimal floating-point > types following the IEEE 754-2008, implemented as a wrapper around the > (BSD-licensed) Intel Decimal Floating-Point Math Library > <https://software.intel.com/en-us/articles/intel-decimal-floating-point-math-library>. > > Decimal floating-point types are useful in situations where you need to > exactly represent decimal values, typically human inputs. > > As software floating point, this is about 100x slower than hardware binary > floating-point math. On the other hand, it is significantly (10-100x) > faster than arbitrary-precision decimal arithmetic, and is a > memory-efficient bitstype. > > The basic arithmetic functions, conversions from other numeric types, and > numerous special functions are supported. >
