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


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

Re: About using assertion

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!selfless.tophat.at!news.glorb.com!npeer01.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!border3.nntp.dca.giganews.com!Xl.tags.giganews.com!border1.nntp.dca.giganews.com!nntp.giganews.com!local2.nntp.dca.giganews.com!nntp.earthlink.com!news.earthlink.com.POSTED!not-for-mail
NNTP-Posting-Date Sat, 21 May 2011 21:00:42 -0500
Date Sat, 21 May 2011 19:00:39 -0700
From Patricia Shanahan <pats@acm.org>
User-Agent Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10
MIME-Version 1.0
Newsgroups comp.lang.java.programmer
Subject Re: About using assertion
References <f1e4cc83-8596-4e53-bed7-34a5209fe8c4@k3g2000prl.googlegroups.com> <92r0e9F6lvU1@mid.individual.net> <sjmea8-067.ln1@tmcd-linux-p4.austin.tx.us> <se-dnUMuGp0Fj0jQnZ2dnUVZ_o-dnZ2d@earthlink.com> <juula8-jc3.ln1@tmcd-linux-p4.austin.tx.us>
In-Reply-To <juula8-jc3.ln1@tmcd-linux-p4.austin.tx.us>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
Message-ID <v_Kdnf49eYLX80XQnZ2dnUVZ_ridnZ2d@earthlink.com> (permalink)
Lines 23
X-Usenet-Provider http://www.giganews.com
NNTP-Posting-Host 75.8.126.96
X-Trace sv3-KYGmp1pBCzOu9py1PGTat6Yn7/Aue56bGUhqlVwSPhKBYyou2uZ5Mo67YmKljWQwTxepQrah7EMeCHH!eeGpIxyPFVmVRSBoJvJC+z2OgANqQz0JM0F7ofrw0KDyZVTxUDOLdlucRu4SXULj3Km2P16CgvOy!WClRHJPiWbc19XnYlN+ntsT936tT1Cj+gTRM5NccShU=
X-Abuse-and-DMCA-Info Please be sure to forward a copy of ALL headers
X-Abuse-and-DMCA-Info Otherwise we will be unable to process your complaint properly
X-Postfilter 1.3.40
X-Original-Bytes 2412
Xref x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:4399

Show key headers only | View raw


On 5/21/2011 4:37 PM, Tim McDaniel wrote:
> In article<se-dnUMuGp0Fj0jQnZ2dnUVZ_o-dnZ2d@earthlink.com>,
> Patricia Shanahan<pats@acm.org>  wrote:
>> Negative zero is a strange beast. As far as I can tell, it exists
>> mainly to produce negative infinity when it is used as a divisor. For
>> example, it is equal to zero for comparison purposes.
>
> Hm, I thought it didn't, but the authoritative-looking but old
> <http://www.concentric.net/~ttwang/tech/javafloat.htm>  says otherwise.

The ultimate authority on comparison in Java is, of course, the JLS.
Section "15.20.1 Numerical Comparison Operators <, <=, >, and >=" says
in the paragraph about floating-point comparisons "Positive zero and
negative zero are considered equal."

[http://java.sun.com/docs/books/jls/third_edition/html/expressions.html#15.20.1]

> However, Float/Double apparently acts differently from float/double:

The Java Comparable interface takes a rather different view of ordering
from IEEE 754, requiring some adjustments.

Patricia

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


Thread

Re: About using assertion tmcd@tmcd-p4-linux.austin.tx.us (Tim McDaniel) - 2011-05-19 00:32 -0500
  Re: About using assertion Michal Kleczek <kleku75@gmail.com> - 2011-05-19 08:34 +0200
    Re: About using assertion Lew <noone@lewscanon.com> - 2011-05-19 08:46 -0400
      Re: About using assertion Michal Kleczek <kleku75@gmail.com> - 2011-05-19 15:16 +0200
        Re: About using assertion Lew <noone@lewscanon.com> - 2011-05-19 09:38 -0400
          Re: About using assertion Robert Klemme <shortcutter@googlemail.com> - 2011-05-19 07:41 -0700
            Re: About using assertion Lew <noone@lewscanon.com> - 2011-05-19 11:00 -0400
  Re: About using assertion Patricia Shanahan <pats@acm.org> - 2011-05-19 05:52 -0700
    Re: About using assertion tmcd@tmcd-p4-linux.austin.tx.us (Tim McDaniel) - 2011-05-21 18:37 -0500
      Re: About using assertion Patricia Shanahan <pats@acm.org> - 2011-05-21 19:00 -0700
      Re: About using assertion Lew <noone@lewscanon.com> - 2011-05-22 01:19 -0400

csiph-web