Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #16334

Re: floating point

Path csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From Jukka Lahtinen <jtfjdehf@hotmail.com.invalid>
Newsgroups comp.lang.java.programmer
Subject Re: floating point
Date Wed, 25 Jul 2012 12:22:02 +0300
Organization A noiseless patient Spider
Lines 17
Message-ID <m3obn4ci11.fsf@ipa.eternal-september.org> (permalink)
References <d94d1dd0-deb5-4259-b5a0-fb3d57e99c55@googlegroups.com> <g9Odnb6dKIkkmJLNnZ2dnUVZ_gudnZ2d@earthlink.com>
Mime-Version 1.0
Content-Type text/plain
Content-Transfer-Encoding 8bit
Injection-Info ipa.eternal-september.org; posting-host="a5a3e65df26a45e8ef56e0325d9681f2"; logging-data="21009"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18fj//Z/aWv/F2M3Jd9oMul"
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.1 (gnu/linux)
Cancel-Lock sha1:bOOu+PUtcFqP42EnjY4KYAffBag= sha1:Ak78sgygrfrnUPjdaKxPozEGMRk=
X-no-archive yes
Xref csiph.com comp.lang.java.programmer:16334

Show key headers only | View raw


Patricia Shanahan <pats@acm.org> writes:
> On 7/24/2012 12:57 PM, bob smith wrote:

>> Let's say you have an integer and a float in an operation.  Is the

> May I ask why you are using float? Because of its very limited
> precision, it is better to use double unless there is a specific reason

..and even better to use BigDecimal, if you need all the decimals to be
correct, like when calculating any amounts of money.

Of course, there are situations where rounding errors don't matter and
double is good enough.
Like, I suppose, some statistical calculations.

-- 
Jukka Lahtinen

Back to comp.lang.java.programmer | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

floating point bob smith <bob@coolfone.comze.com> - 2012-07-24 12:57 -0700
  Re: floating point markspace <-@.> - 2012-07-24 13:01 -0700
    Re: floating point Lew <lewbloch@gmail.com> - 2012-07-24 13:21 -0700
      Re: floating point Gene Wirchenko <genew@ocis.net> - 2012-07-24 13:50 -0700
        Re: floating point Lew <noone@lewscanon.com> - 2012-07-25 06:33 -0700
          Re: floating point Gene Wirchenko <genew@ocis.net> - 2012-07-25 10:44 -0700
            Re: floating point Lew <lewbloch@gmail.com> - 2012-07-25 17:09 -0700
              Re: floating point Gene Wirchenko <genew@ocis.net> - 2012-07-25 17:42 -0700
                Re: floating point Jan Burse <janburse@fastmail.fm> - 2012-07-26 03:15 +0200
          Re: floating point Arne Vajhøj <arne@vajhoej.dk> - 2012-07-25 21:05 -0400
    Re: floating point Martin Gregorie <martin@address-in-sig.invalid> - 2012-07-24 20:34 +0000
  Re: floating point Patricia Shanahan <pats@acm.org> - 2012-07-24 13:29 -0700
    Re: floating point Jukka Lahtinen <jtfjdehf@hotmail.com.invalid> - 2012-07-25 12:22 +0300
      Re: floating point Arne Vajhøj <arne@vajhoej.dk> - 2012-07-25 10:54 -0400
      Re: floating point Roedy Green <see_website@mindprod.com.invalid> - 2012-07-25 13:29 -0700

csiph-web