Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: BGB Newsgroups: comp.lang.java.programmer Subject: Re: higher precision doubles Date: Sat, 06 Aug 2011 16:12:51 -0700 Organization: albasani.net Lines: 37 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net 5KJjOt9otwBzg9GeYE2VMSGu1TE/cyGWHykvgTJ/RAAfM+2nCZXxZyJYB5owoAHEaHpzf+a10vhUTZphSq4A3g== NNTP-Posting-Date: Sat, 6 Aug 2011 23:17:38 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="ABaxItZbeVwMexoiSQFQ1KKYxfJAvEyz0Mh0dSoMFY6A7WEoeaiqTN3zrgLrHLs6QKeobY9Cr0AE50Oo7at3oOwdxCAmQCikftUeYZE9fwsdivTORQPGUHb2CIcrI4tE"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 In-Reply-To: Cancel-Lock: sha1:rTyTxkIreDUyJ6OtzMkOZfshUZw= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6838 On 8/6/2011 2:30 PM, Jan Burse wrote: > BGB schrieb: >> also possible is, of course, to use BigDecimal or similar (as others >> have noted), or implement ones' own higher-precision floating point > > BigDecimal Ops with MathContext would probably do, although I > have never tried it. But would need to do my own DECIMAL80, > since there is only DECIMAL64 and DECIMAL128. And would not > cover any exponent restriction, only mantissa restriction. > > But wait, would BigDecimal really do? I am asking here for > pi and sin. But when I look at BigDecimal I only see some > basic arithmetic and some number theory. > > So where is the trigonomy package for BigDecimal? > I am not aware of any (but, Java is not my main language FWIW), but it is possible for one to write these themselves. for example, see here: http://en.wikipedia.org/wiki/Taylor_series and: http://en.wikipedia.org/wiki/Trigonometric_function I had actually done this when implementing some of my own math functions (mostly in the case of implementing quaternions and also a float128 type), however, this was in C. > Bye > > http://download.oracle.com/javase/1,5.0/docs/api/java/math/BigDecimal.html > http://download.oracle.com/javase/1,5.0/docs/api/java/math/MathContext.html > >