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


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

Re: floating point

Path csiph.com!usenet.pasdenom.info!gegeweb.org!eternal-september.org!feeder.eternal-september.org!mx04.eternal-september.org!.POSTED!not-for-mail
From markspace <-@.>
Newsgroups comp.lang.java.programmer
Subject Re: floating point
Date Tue, 24 Jul 2012 13:01:11 -0700
Organization A noiseless patient Spider
Lines 13
Message-ID <jumuu7$6np$1@dont-email.me> (permalink)
References <d94d1dd0-deb5-4259-b5a0-fb3d57e99c55@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Injection-Date Tue, 24 Jul 2012 20:01:11 +0000 (UTC)
Injection-Info mx04.eternal-september.org; posting-host="61282af8d6595e8d991edb5ac03d6e00"; logging-data="6905"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/aQjnoCG3f9CWvaIFRfV10zABHrhcOSHc="
User-Agent Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0
In-Reply-To <d94d1dd0-deb5-4259-b5a0-fb3d57e99c55@googlegroups.com>
Cancel-Lock sha1:XM2xsSzswAnLJNZhdje5WAPGwh0=
Xref csiph.com comp.lang.java.programmer:16310

Show key headers only | View raw


On 7/24/2012 12:57 PM, bob smith wrote:
> I can never remember this.
>
> Let's say you have an integer and a float in an operation.  Is the result always a float?


You can just try this to see what you get, or read the JLS.  From 
memory, I'm 90% sure that ints will be promoted to floats.  I'm not sure 
how order of operations affects this.  In the expression (1+1)/2.0f, 
does the addition use floats or ints?  I'm not sure, but I think ints.


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