Return-Path: X-Original-To: apmail-groovy-users-archive@minotaur.apache.org Delivered-To: apmail-groovy-users-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id D957F183E3 for ; Mon, 21 Sep 2015 14:15:02 +0000 (UTC) Received: (qmail 41710 invoked by uid 500); 21 Sep 2015 14:15:02 -0000 Delivered-To: apmail-groovy-users-archive@groovy.apache.org Received: (qmail 41678 invoked by uid 500); 21 Sep 2015 14:15:02 -0000 Mailing-List: contact users-help@groovy.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@groovy.incubator.apache.org Delivered-To: mailing list users@groovy.incubator.apache.org Received: (qmail 41668 invoked by uid 99); 21 Sep 2015 14:15:02 -0000 Received: from Unknown (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 21 Sep 2015 14:15:02 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 366141A51A8 for ; Mon, 21 Sep 2015 14:15:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.172 X-Spam-Level: *** X-Spam-Status: No, score=3.172 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=3, PLING_QUERY=0.279, RP_MATCHES_RCVD=-0.006, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); domainkeys=pass (1024-bit key) header.from=Jason.Winnebeck@windstream.com header.d=windstream.com; dkim=pass (1024-bit key) header.d=windstream.com Received: from mx1-us-west.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id L9z6vAx_7EVj for ; Mon, 21 Sep 2015 14:15:00 +0000 (UTC) Received: from dell904.windstream.com (dell904.windstream.com [173.186.244.142]) by mx1-us-west.apache.org (ASF Mail Server at mx1-us-west.apache.org) with ESMTPS id 9534A206AE for ; Mon, 21 Sep 2015 14:15:00 +0000 (UTC) Received: from neohtwnap001.windstream.com (neohtwnap001.windstream.com [10.105.100.27]) by dell904.windstream.com (8.15.1/8.13.1) with ESMTP id t8LEEqLa030122 for ; Mon, 21 Sep 2015 10:14:53 -0400 DomainKey-Signature: a=rsa-sha1; s=emp2q2010; d=windstream.com; c=nofws; q=dns; h=dkim-signature:from:to:subject:date:message-id: accept-language:content-language:x-ms-has-attach:x-originating-ip: x-proofpoint-virus-version:x-proofpoint-spam-details; b=Oe9Y6UtemwBD+YrUiT2MpY/96CoPxXPXD1qj0Fbjea2TEUrdcZNfZhoBz8ZtqdzBm ZhkCkdNl5nxLTPQbryCmenZvPbm2fmpZbycwBgZcHpB9ZPcGXaHJct9WcDme3ZjsyQf wjNO5QKwuXzbQGOtNO5HdADm3FOwQDd0d/eoF0w= DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=windstream.com; s=emp2q2010; t=1442844893; bh=aPI8PnlAQE0t4F2j7XR3cpXGyGzUgeciLJml3QVqj9w=; h=From:To:Subject:Date:Message-ID; b=1DJm8hLHG2IIvPLe/X5V4It9NW9mp8lDwbQf8kF+EW302JzJ4Xpio/HP+g7SuXWcX pzW00LtNjtFwK9Oie3UorJrK5+wqZ99xXOJYliyotuMXLXJjXW23ZQYEsBpnquO7P3 aY9dIsAv9Xc5rA8TOrGsHBaJCavhm/hwd5J1tLT8= Received: from pps.filterd (neohtwnap001.windstream.com [127.0.0.1]) by neohtwnap001.windstream.com (8.14.7/8.14.7) with SMTP id t8LEBDhq029039 for ; Mon, 21 Sep 2015 07:14:52 -0700 Received: from cwwapp461.windstream.com (cwwapp461.windstream.com [10.104.100.213]) by neohtwnap001.windstream.com with ESMTP id 1wxsu7eqnk-2 for ; Mon, 21 Sep 2015 07:14:52 -0700 Received: from CWWAPP470.windstream.com (10.104.100.217) by CWWAPP461.windstream.com (10.104.100.213) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 21 Sep 2015 10:14:52 -0400 Received: from CWWAPP478.windstream.com ([fe80::6d3c:7b7f:b5fc:ad94]) by CWWAPP470.windstream.com ([::1]) with mapi id 14.03.0195.001; Mon, 21 Sep 2015 10:14:51 -0400 From: "Winnebeck, Jason" To: "users@groovy.incubator.apache.org" Subject: Is NaN ==/!= NaN guaranteed to be consistent in all Groovy versions? Thread-Topic: Is NaN ==/!= NaN guaranteed to be consistent in all Groovy versions? Thread-Index: AdD0d+DDbzYoH0UGQnCg3P1Nk/EBWA== Date: Mon, 21 Sep 2015 14:14:50 +0000 Message-ID: <5C676E6359909E478C7B811BDB48CA35415C65@CWWAPP478.windstream.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.140.41.182] Content-Type: multipart/alternative; boundary="_000_5C676E6359909E478C7B811BDB48CA35415C65CWWAPP478windstre_" MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:5.14.151,1.0.33,0.0.0000 definitions=2015-09-21_05:2015-09-21,2015-09-21,1970-01-01 signatures=0 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=0 phishscore=0 adultscore=0 bulkscore=1 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1508030000 definitions=main-1509210216 --_000_5C676E6359909E478C7B811BDB48CA35415C65CWWAPP478windstre_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I see in Groovy that =3D=3D and !=3D work to compare variables against NaN.= The rationale seems to be that compareTo is used instead of primitive comp= arisons or equals. Is this behavior guaranteed to be defined this way in al= l future versions of Groovy? I've come across some Groovy code that is doing "x !=3D Float.NaN" and in a= ll of the test cases it seems to work. I ask because I'm afraid of primopts= or static compiler in the future perhaps replacing the float to float comp= arison with a primitive !=3D, which returns false always in Java, but if th= is is a locked in behavior for Groovy, then I won't worry about refactoring= existing code. I see that https://issues.apache.org/jira/browse/GROOVY-3309 addresses this= and Jochen responded to it but it was left open instead of closed as "won'= t fix", which concerns me that Groovy team may introduce a breaking change = in the future. Jason ---------------------------------------------------------------------- This email message and any attachments are for the sole use of the intended= recipient(s). Any unauthorized review, use, disclosure or distribution is = prohibited. If you are not the intended recipient, please contact the sende= r by reply email and destroy all copies of the original message and any att= achments. --_000_5C676E6359909E478C7B811BDB48CA35415C65CWWAPP478windstre_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I see in Groovy that =3D=3D and !=3D work to compare= variables against NaN. The rationale seems to be that compareTo is used in= stead of primitive comparisons or equals. Is this behavior guaranteed to be= defined this way in all future versions of Groovy?

 

I’ve come across some Groovy code that is doin= g “x !=3D Float.NaN” and in all of the test cases it seems to w= ork. I ask because I’m afraid of primopts or static compiler in the f= uture perhaps replacing the float to float comparison with a primitive !=3D, which returns false always in Java, but if this is a locke= d in behavior for Groovy, then I won’t worry about refactoring existi= ng code.

 

I see that https://issues.apache.org/jira/browse/GROOVY-3309 addresses this and Jo= chen responded to it but it was left open instead of closed as “won&#= 8217;t fix”, which concerns me that Groovy team may introduce a break= ing change in the future.

 

Jason


This email message and any attachments are for the sole use of the inte= nded recipient(s). Any unauthorized review, use, disclosure or distribution= is prohibited. If you are not the intended recipient, please contact the s= ender by reply email and destroy all copies of the original message and any= attachments.
--_000_5C676E6359909E478C7B811BDB48CA35415C65CWWAPP478windstre_--