Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #12286
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Fixed-point arithmetic library |
| Date | 2012-02-23 15:08 -0800 |
| Organization | A noiseless patient Spider |
| Message-ID | <2jhdk79roda4j7b34gq7cd2t6rrcb1icct@4ax.com> (permalink) |
| References | (1 earlier) <9ql7jpF3mnU1@mid.individual.net> <nksak719f3qtnogigv4cunsurbv0ti1rk7@4ax.com> <alpine.DEB.2.00.1202232115290.23797@urchin.earth.li> <d3ddk7ps3kocbm4f52f7d4c9ku9ibenakg@4ax.com> <ji6fce$uvu$1@news.albasani.net> |
On Thu, 23 Feb 2012 14:42:23 -0800, Lew <noone@lewscanon.com> wrote:
>On 02/23/2012 02:03 PM, Gene Wirchenko wrote:
[snip]
>> Looking up further, according to Wikipedia, there is a 128-bit
>> format that has 34.02 [decimal] digits of precision. If your target language
>> has this format as one of its number types, you could store integers
>> in such variables. You did state that you need 30 [decimal] digits of
>> precision, so this would fit. This would be a cheap, fairly simple
>> solution.
>
>Are you taking into account the precision of intermediate results?
OP apparently already has. Take a look at his original post.
>If you multiply to 30-digit values you need 60 digits of precision to
>represent the calculation.
His numbers are not quite THAT big.
>This is a good time to recommend that everyone read "What Every Computer
>Scientist Should Know About Floating Point Arithmetic", by David Goldberg.
Yes.
It is also worth pointing out that many *integer* values can be
represented exactly in floating point. The emphasis on "integer" is
deliberate.
Sincerely,
Gene Wirchenko
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar
Fixed-point arithmetic library Tom Anderson <twic@urchin.earth.li> - 2012-02-22 21:39 +0000
Re: Fixed-point arithmetic library Jan Burse <janburse@fastmail.fm> - 2012-02-22 22:59 +0100
Re: Fixed-point arithmetic library Tom Anderson <twic@urchin.earth.li> - 2012-02-23 21:15 +0000
Re: Fixed-point arithmetic library markspace <-@.> - 2012-02-23 13:53 -0800
Re: Fixed-point arithmetic library Robert Klemme <shortcutter@googlemail.com> - 2012-02-23 23:21 +0100
Re: Fixed-point arithmetic library Jan Burse <janburse@fastmail.fm> - 2012-02-24 00:02 +0100
Re: Fixed-point arithmetic library Robert Klemme <shortcutter@googlemail.com> - 2012-02-22 23:13 +0100
Re: Fixed-point arithmetic library Gene Wirchenko <genew@ocis.net> - 2012-02-22 14:59 -0800
Re: Fixed-point arithmetic library Martin Gregorie <martin@address-in-sig.invalid> - 2012-02-23 01:05 +0000
Re: Fixed-point arithmetic library Tom Anderson <twic@urchin.earth.li> - 2012-02-23 21:21 +0000
Re: Fixed-point arithmetic library Gene Wirchenko <genew@ocis.net> - 2012-02-23 13:49 -0800
Re: Fixed-point arithmetic library Tom Anderson <twic@urchin.earth.li> - 2012-02-23 21:16 +0000
Re: Fixed-point arithmetic library Gene Wirchenko <genew@ocis.net> - 2012-02-23 14:03 -0800
Re: Fixed-point arithmetic library Lew <noone@lewscanon.com> - 2012-02-23 14:42 -0800
Re: Fixed-point arithmetic library Gene Wirchenko <genew@ocis.net> - 2012-02-23 15:08 -0800
Re: Fixed-point arithmetic library Martin Gregorie <martin@address-in-sig.invalid> - 2012-02-23 23:05 +0000
Re: Fixed-point arithmetic library glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-02-27 00:59 +0000
Re: Fixed-point arithmetic library Arne Vajhøj <arne@vajhoej.dk> - 2012-02-26 20:50 -0500
Re: Fixed-point arithmetic library Robert Klemme <shortcutter@googlemail.com> - 2012-02-27 07:32 +0100
Re: Fixed-point arithmetic library Jan Burse <janburse@fastmail.fm> - 2012-02-27 13:46 +0100
Re: Fixed-point arithmetic library Roedy Green <see_website@mindprod.com.invalid> - 2012-02-24 16:26 -0800
csiph-web