delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2018/02/04/17:59:46

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:to:subject:content-type;
q=dns; s=default; b=XStgBefhB492tgPxSLgm+4J+ij/PQ4Y8wl7e11ShPuJ
Ayyz1BiYVroY1q4Ov/1uxkGGF/eqoS3orUiZpw56EY2Iu8VVQo3oXtehOcq+dbga
vjpop7HPua8OynA1i/HVio6QCSv8nvdoTE+550G2DvTsh2JZPaWjD7lLMvq8k1xw
=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:message-id:date:from:to:subject:content-type;
s=default; bh=5USb3Bk+a6BIDSlRywfp7Y4/Kaw=; b=emNQ46y7LiYQ46ZpU
gIAzSxfaofg0BNbc+nzxkQIFl8JHtt/sLN6MsgRu7ffIVm76OK41HCATYHcAG6TU
FHTuv+S731u/1RbXNMhpfUGBjbWar/ksVqD3FpjbOAMO5lgr/yHKQK8/7UB7T+UH
ZKsLDUCyQ6EnjqoMRM5i4zHe6A=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*UA:github.com, H*MI:google, H*M:google
X-HELO: mail-ot0-f172.google.com
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:date:from:to:subject:user-agent; bh=+ySyjstImUGaNlxikR2AHmPgAIAEKnCoBrRv+7UO9S8=; b=rdrTSQKFZWn8qFcLTyBUzoFZ5wQU2EIp23iE7ogyuQTegvXMsGpPJOdrJ9xT3uJUqy iRKHZDp6zF/+y5XSaBTnibJJzLzuhHFymxptW5unH4PKQB3uMEn5mJM4ItEB9Eeq8akN MIgbRZsBTG49NeB2eYV2BHYio1bHwA+fgZbV6FhdSw0ohzG1NLwMQrLfqrFj1twYtAsx HRnayj5Td8B8XGs2cwgWj4Q2CQ052hDXTgqCmYNp9xfsF/LEceNhmqPRi124DRssROav kp2M//UncYLvyrY0gEAl5hzw0cbwXTanwCUe3Zu3qWAmx85ad4TMS86ZOaCU1+xRJbtv BXXQ==
X-Gm-Message-State: AKwxytdHZ9aH5R+FaECpL0VGnD44KdDsurz3Vr8l5QAIlwEEJ0xjL88s 37cOADo9W2UXmLAi20Fci7ZMGQ==
X-Google-Smtp-Source: AH8x227CXE3w+jHqWWVbiAjQ4b4vUzUU85tk1/EJzvbBbSgNgXKadTeve38ISSJGJv50kAQVqDvQYg==
X-Received: by 10.157.50.132 with SMTP id u4mr12706195otb.133.1517785171344; Sun, 04 Feb 2018 14:59:31 -0800 (PST)
Message-ID: <5a779052.964c9d0a.b1d8f.e4da@mx.google.com>
Date: Sun, 04 Feb 2018 14:59:30 -0800 (PST)
From: Steven Penny <svnpenn AT gmail DOT com>
X-Google-Original-From: Steven Penny
To: cygwin AT cygwin DOT com
Subject: gawk: regression with unary plus
User-Agent: Tryst/2.3.0 (github.com/svnpenn/tryst)

Previously conversions could be triggered by either adding zero (+0), unary
plus (+) or unary minus (-) [1]:

    $ gawk --version
    GNU Awk 4.1.4, API: 1.1 (GNU MPFR 3.1.6-p1, GNU MP 6.1.2)

    $ ./gawk 'BEGIN {print "01" + 0}'
    1

    $ ./gawk 'BEGIN {print +"01"}'
    1

    $ ./gawk 'BEGIN {print -"01"}'
    -1

However now conversion only happens with adding zero and unary minus:

    $ gawk --version
    GNU Awk 4.2.0, API: 2.0 (GNU MPFR 3.1.6-p1, GNU MP 6.1.2)

    $ gawk 'BEGIN {print "01" + 0}'
    1

    $ gawk 'BEGIN {print +"01"}'
    01

    $ gawk 'BEGIN {print -"01"}'
    -1

Does anyone know where this change was mentioned or why it was done?

[1] http://pubs.opengroup.org/onlinepubs/9699919799/utilities/awk.html


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019