Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.java.programmer > #35826
| From | Michael Jung <miju@golem.phantasia.org> |
|---|---|
| Newsgroups | comp.lang.java.programmer |
| Subject | Re: double == double |
| Date | 2016-10-19 19:39 +0200 |
| Organization | albasani.net |
| Message-ID | <87d1iw9r1s.fsf@golem.phantasia.org> (permalink) |
| References | <double-20161012130409@ram.dialup.fu-berlin.de> <nu7quv$aur$1@dont-email.me> <nu7sl4$h0a$1@dont-email.me> |
Eric Sosman <esosman@comcast-dot-net.invalid> writes:
> On 10/19/2016 9:03 AM, Mike Amling wrote:
>> public static double max(final double a, final double b) {
>> return a==0.0 && b==0.0 ? 0.0 : (a>=b ? a : b);
>> }
or
public static double max(final double a, final double b) {
return a>=b ? a : b;
}
> This would return +0.0 for max(-0.0, -0.0).
Why would that be wrong?
Michael
Back to comp.lang.java.programmer | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Re: double == double Mike Amling <mamling@chaff.us> - 2016-10-19 08:03 -0500
Re: double == double Eric Sosman <esosman@comcast-dot-net.invalid> - 2016-10-19 09:32 -0400
Re: double == double Jerry Stuckle <jstucklex@attglobal.net> - 2016-10-19 10:26 -0400
Re: double == double Jake Jarvis <pig_in_shoes@yahoo.com> - 2016-10-19 16:36 +0200
Re: double == double Jerry Stuckle <jstucklex@attglobal.net> - 2016-10-19 16:50 -0400
Re: double == double Jake Jarvis <pig_in_shoes@yahoo.com> - 2016-10-20 01:08 +0200
Re: double == double Arne Vajhøj <arne@vajhoej.dk> - 2016-10-19 21:16 -0400
Re: double == double Arne Vajhøj <arne@vajhoej.dk> - 2016-10-19 21:19 -0400
Re: double == double Jerry Stuckle <jstucklex@attglobal.net> - 2016-10-19 21:47 -0400
Re: double == double Arne Vajhøj <arne@vajhoej.dk> - 2016-10-19 21:52 -0400
Re: double == double Michael Jung <miju@golem.phantasia.org> - 2016-10-19 19:39 +0200
Re: double == double Mike Amling <mamling@chaff.us> - 2016-10-22 07:15 -0500
csiph-web