From owner-sc22wg5+sc22wg5-dom8=www.open-std.org@open-std.org  Wed Aug 24 10:47:11 2016
Return-Path: <owner-sc22wg5+sc22wg5-dom8=www.open-std.org@open-std.org>
X-Original-To: sc22wg5-dom8
Delivered-To: sc22wg5-dom8@www.open-std.org
Received: by www.open-std.org (Postfix, from userid 521)
	id 25DAD358484; Wed, 24 Aug 2016 10:47:11 +0200 (CEST)
Delivered-To: sc22wg5@open-std.org
Received: from mail-wm0-f46.google.com (mail-wm0-f46.google.com [74.125.82.46])
	(using TLSv1 with cipher AES128-SHA (128/128 bits))
	(No client certificate requested)
	by www.open-std.org (Postfix) with ESMTP id AB99A3568F8
	for <sc22wg5@open-std.org>; Wed, 24 Aug 2016 10:47:09 +0200 (CEST)
Received: by mail-wm0-f46.google.com with SMTP id f65so191310078wmi.0
        for <sc22wg5@open-std.org>; Wed, 24 Aug 2016 01:47:09 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=bris-ac-uk.20150623.gappssmtp.com; s=20150623;
        h=date:from:message-id:to:subject:reply-to:in-reply-to;
        bh=lwWaMlS/HGxvzO/Y0mIOZOWzyVGOLGb77MaydtxCc4U=;
        b=EIHZpyGXrl9qg8R87Ub/KrT1VV9C7Wd0C/JIpyQ63pt0bI061HSRXgHKPrhelfrk8Q
         jGNkVnzjn6c4HMxDUtKm2uQdnviT+Lb/eMFeBSjCnhHw4c1pHUIEYUTV+9nyo2DepLe1
         kghcRgZ28EcXFdWmK2APnhD84VB2xEOh3EfXe+UwibWWxjEBMZnfVxvIvK3M1uG8qpuN
         RZLh+U8LdPzouNjqgusBajmDBGKr+6XVplrIHBo8bidqmLNGX0wI9Hbd+vqia0A7k/55
         WJZuI5R0vlY9GxaIAp2WTALmlM3NrjItr8PWrHSUdL9eYvwKnK96lekjtRcuP+AFPn78
         z//w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20130820;
        h=x-gm-message-state:date:from:message-id:to:subject:reply-to
         :in-reply-to;
        bh=lwWaMlS/HGxvzO/Y0mIOZOWzyVGOLGb77MaydtxCc4U=;
        b=Oy+rq2qPZFuhHirFvY9KSeFYQf+vyyrPEeFgWICUK6EjWk8i3VBXRaHJ9HgNqplLsj
         xdIabn5WqpgcJuIblzfMok8LNW42xPr4h8O6gknHPzgg0iGsYzWqqYkcVKSd5w9Mh3j8
         IHF/yFIoSNNhFM5edSHQ/RwIIlZ6wHMRJzYwcx5HBnhHvWXrQ/NKHwte4UbeqNdH+Jhz
         gGDrbGC9prprKtTQQW2iHKmkxTJUhJRnPTVDN/xKNaFy+rGZ1O8iv/ywYGChPUCz0dG9
         W1CakDWGkc9f8AHFXxI35vY+OPbkUUPGQlTOAge0C5wUmwNN3WG9h/ogrOyR3J2J9pAg
         VTgA==
X-Gm-Message-State: AEkoousUNRd7PzTlqhSBs2NIS4w1EzedG+fOyUaNYnnmXmU85CWxGNzQQTGSMXbMh1IJu8t9
X-Received: by 10.194.114.100 with SMTP id jf4mr1533547wjb.87.1472028428744;
        Wed, 24 Aug 2016 01:47:08 -0700 (PDT)
Received: from mech-as222.men.bris.ac.uk (mech-as222.men.bris.ac.uk. [137.222.170.4])
        by smtp.gmail.com with ESMTPSA id 17sm9374836wmf.6.2016.08.24.01.47.08
        for <sc22wg5@open-std.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Wed, 24 Aug 2016 01:47:08 -0700 (PDT)
Received: from mech-as222.men.bris.ac.uk (localhost [127.0.0.1])
	by mech-as222.men.bris.ac.uk (8.15.2/8.15.2) with ESMTP id u7O8l7qb082552
	for <sc22wg5@open-std.org>; Wed, 24 Aug 2016 09:47:07 +0100 (BST)
	(envelope-from mexas@mech-as222.men.bris.ac.uk)
Received: (from mexas@localhost)
	by mech-as222.men.bris.ac.uk (8.15.2/8.15.2/Submit) id u7O8l7ul082551
	for sc22wg5@open-std.org; Wed, 24 Aug 2016 09:47:07 +0100 (BST)
	(envelope-from mexas)
Date: Wed, 24 Aug 2016 09:47:07 +0100 (BST)
From: Anton Shterenlikht <mexas@bris.ac.uk>
Message-Id: <201608240847.u7O8l7ul082551@mech-as222.men.bris.ac.uk>
To: sc22wg5@open-std.org
Subject: Re: (j3.2006) (SC22WG5.5781) [ukfortran] edits to clarify SQRT treatment ofnegative zero, for comments
Reply-To: mexas@bris.ac.uk
In-Reply-To: <20160824074445.BD389357139@www.open-std.org>
Sender: owner-sc22wg5@open-std.org
Precedence: bulk

>From: "Cohen Malcolm" <malcolm@nag-j.co.jp>
>
>I would prefer to leave the "principal value" wording alone.
>
>I also prefer to leave the "When the real part of the result is zero" 
>wording alone.  Unless you enjoy posing maths questions of people reading 
>the standard to work out whether anything changed.
>
>I also don't think this is necessary - the likely reason vendors did not 
>spot the change in semantics from previous Fortran standards (77 and 90 both 
>forbid negative real zero being treated differently from positive real zero) 
>is just that the change in semantics occurs without any wording change in 
>SQRT itself.  That is, the word "sign" in the description does not refer to 
>the SIGN intrinsic directly, however since the SIGN intrinsic returns the 
>"Magnitude of A with the sign of B", it is clear that "the same sign as" a 
>distinguished negative real zero means a negative value.  It could well be 
>more effective to point out to the offending vendor(s) that they overlooked 
>this Fortran 95 change in semantics than to edit SQRT like this.  (I don't 
>actively object to editing SQRT to make it more obvious though, if that's 
>what people want; just that it's not necessary.)

[56:21-25 4.4.3.2p3] is very clear on the rules:
"Processors that distinguish between
positive and negative zeros shall
treat them as mathematically equivalent
...
as actual arguments to intrinsic procedures
other than those for which it is
explicitly specified that negative
zero is distinguished."

SQRT does not "explicitly specify" that
negative zero is distinguished.
Implicitly, following the SIGN logic, yes.
But not explicitly. So strictly following
[56:21-25] SQRT does not distinguish between
positive and negative zero.
So it seems to me
the wording must be changed to
explicitly specify that negative zero
is distinguished.

>The paper needs to add text to the Fortran 90 compatibility and Fortran 77 
>compatibility subclauses to mention the change in semantics (close to where 
>we talk about SIGN).

I understood the logic of compatibility
subclauses as accumulative, i.e.
Fortran 90 compatibility clause lists
only differences not already mentioned
in the preceding subclauses for f95 and f03.
Is that wrong? Is the aim to list the full
list of differences between f08 and f77
under Fortran 77 compatibility?

>Finally, with luck and a fair breeze 16-007r2 should be available early 
>September so I recommend waiting until then so that you can produce edits 
>against what will be the actual live draft.

Thank you

Anton
