Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #14378
| From | Gene Wirchenko <genew@ocis.net> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: Sorting numeric strings |
| Date | 2012-05-07 11:42 -0700 |
| Organization | A noiseless patient Spider |
| Message-ID | <9m5gq7tlb2n9ogivkt2lmi8do5beohrkvb@4ax.com> (permalink) |
| References | (5 earlier) <jo1cje$o4a$1@localhost.localdomain> <gkh8q712jvs0scpgtil3ull4cssmis5v1k@4ax.com> <jo1p6k$ra8$2@localhost.localdomain> <pj1gq7tjiuh46n06r2m05iprf0vbvihm70@4ax.com> <jo91u7$h3c$1@speranza.aioe.org> |
On Mon, 7 May 2012 17:48:55 +0000 (UTC), glen herrmannsfeldt
<gah@ugcs.caltech.edu> wrote:
>Gene Wirchenko <genew@ocis.net> wrote:
>
>(snip)
>> Floating point can represent some integer values exactly. The
>> IEEE 754 64-bit format has 53 bits of precision. This is not quite 16
>> digits of precision. Stick with integer values in the range
>> (-10^15,10^15) (an exclusive range), and they will all be represented
>> exactly.
>
>I believe that addition, subtraction, and multiplication should
>give the right answer as long as it stays within range.
>
>Divide is less obvious. Are you sure that there are no cases
>where divide will round incorrectly?
I have not dealt with division since I do not need it in general.
I do need rounding though, and I use modulo to do that. Were I
to need division, I would round the same way.
Sincerely,
Gene Wirchenko
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Sorting numeric strings Ben <no@way.com> - 2012-04-30 21:27 -0400
Re: Sorting numeric strings Arne Vajhøj <arne@vajhoej.dk> - 2012-04-30 21:39 -0400
Re: Sorting numeric strings Gene Wirchenko <genew@ocis.net> - 2012-05-01 10:30 -0700
Re: Sorting numeric strings Daniel Pitts <newsgroup.nospam@virtualinfinity.net> - 2012-05-01 10:53 -0700
Re: Sorting numeric strings Roedy Green <see_website@mindprod.com.invalid> - 2012-05-01 14:50 -0700
Re: Sorting numeric strings Patricia Shanahan <pats@acm.org> - 2012-05-01 15:02 -0700
Re: Sorting numeric strings Roedy Green <see_website@mindprod.com.invalid> - 2012-05-02 14:36 -0700
Re: Sorting numeric strings Gene Wirchenko <genew@ocis.net> - 2012-05-02 19:57 -0700
Re: Sorting numeric strings Dr J R Stockton <reply1218@merlyn.demon.co.uk.not.invalid> - 2012-05-03 19:41 +0100
Re: Sorting numeric strings Roedy Green <see_website@mindprod.com.invalid> - 2012-05-03 17:40 -0700
Re: Sorting numeric strings Lew <lewbloch@gmail.com> - 2012-05-03 18:11 -0700
Re: Sorting numeric strings Martin Gregorie <martin@address-in-sig.invalid> - 2012-05-04 20:01 +0000
Re: Sorting numeric strings Gene Wirchenko <genew@ocis.net> - 2012-05-04 14:19 -0700
Re: Sorting numeric strings Martin Gregorie <martin@address-in-sig.invalid> - 2012-05-04 23:36 +0000
Re: Sorting numeric strings Dr J R Stockton <reply1218@merlyn.demon.co.uk.not.invalid> - 2012-05-06 17:50 +0100
Re: Sorting numeric strings Gene Wirchenko <genew@ocis.net> - 2012-05-07 10:34 -0700
Re: Sorting numeric strings Joshua Cranmer <Pidgeot18@verizon.invalid> - 2012-05-07 12:38 -0500
Re: Sorting numeric strings glen herrmannsfeldt <gah@ugcs.caltech.edu> - 2012-05-07 17:48 +0000
Re: Sorting numeric strings Gene Wirchenko <genew@ocis.net> - 2012-05-07 11:42 -0700
Re: Sorting numeric strings Roedy Green <see_website@mindprod.com.invalid> - 2012-05-01 13:38 -0700
csiph-web