Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!nx01.iad01.newshosting.com!newshosting.com!news2.euro.net!feeder.news-service.com!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Joshua Cranmer Newsgroups: comp.lang.java.programmer Subject: Re: higher precision doubles Date: Mon, 08 Aug 2011 21:34:23 -0500 Organization: A noiseless patient Spider Lines: 33 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Tue, 9 Aug 2011 02:34:30 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="B3q1fNdvNsCxx/IZ4idKGA"; logging-data="3481"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19jZXCeyKYomMlmVcBNsljUc5lcDAypIS8=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 In-Reply-To: Cancel-Lock: sha1:1/lTt6/LaQsAd3nuF4f3O7+PeeM= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6893 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