"In general, you should be able to use the DecFP types in any context where you would have used binary floating-point types: arrays, complex arithmetic, and linear algebra should all work, for the most part."
Way better than what I was going for - I thought only +, -, *, / was needed and maybe only wanted.. plus convert but not automatic: "Mixed operations involving decimal and binary floating-point or integer types are supported (the result is promoted to decimal floating-point)." Is that really advised? Is that what you do or the C library? In C you have automatic promotion between native types, but I guess you can't otherwise. The library you wrap provides converts (good), you make them automatic (bad?). At first blush, as Julia is generic by default, this seems what you would want, but is it? When I thought about this, it seemed just dangerous. If you force people to use manual conversion you might get away with wrapping fewer functions? "Most basic arithmetic functions are supported, and many special functions ( sqrt, log, trigonometric functions, etc.)." I'm not sure if the library you wrap provides this and if it does, doesn't convert to binary floating point, runs the function, then converts back? Whether it does it or you do it, is it not better to let the user decide on both converts? And faster if you eliminate some.. I just scanned the code or one file: for c in (:π, :e, :γ, :catalan, :φ) Not sure if these are the only Julia constants.. Or only you care about. Anyway, wasn't expecting to see them in any decimal context. I would not be rich with π dollars in my account. :) -- Palli. On Wednesday, April 29, 2015 at 1:26:17 AM UTC, 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. >
