Re: higher precision doubles
On 8/8/2011 12:08 PM, Jan Burse wrote:
Just assume I want to put the functionality into an Applet. Means
somehow the aspect of supporting a couple of plattforms and
architectures is important.
Using native APIs in an applet is impossible without signing your
applet. This would either imply using BigDecimal, signing your code, or
making do with a pure software implementation.
Also note that not all architectures support an 80-bit
extended-precision floating point format. Not that ARM sports an FPU,
but its most common FPU coprocessor fails to implement 80-bit width, and
I should mention that ARM processors are by far much more common than
the install base of x86. In fact, I think the only processor with a
significant install base that has hardware support for a floating point
number larger than 64 bits is the x86.
Also one could implement mutable objects (instances) instead of
value objects (instances). So that instead of an API of the form:
Small mutable objects like this are likely to negatively impact GC.
One could also do:
myMath:
sin(myMutableObjectClass x, myMutableObjectClass res);
If you're only using the mutable object for the return value, you are
probably taking a very small performance hit.
--
Beware of bugs in the above code; I have only proved it correct, not
tried it. -- Donald E. Knuth