[{"id":1761186,"web_url":"http://patchwork.ozlabs.org/comment/1761186/","msgid":"<CAKCAbMhj_gmveaW6G-sj=vPzr30N3m_+hb-0TtFYzd9v4bCptw@mail.gmail.com>","list_archive_url":null,"date":"2017-08-31T16:48:53","subject":"Re: Simplify HUGE_VAL definitions [committed]","submitter":{"id":65878,"url":"http://patchwork.ozlabs.org/api/people/65878/","name":"Zack Weinberg","email":"zackw@panix.com"},"content":"On Thu, Aug 31, 2017 at 11:51 AM, Joseph Myers <joseph@codesourcery.com> wrote:\n> There are various bits/huge_val*.h headers to define HUGE_VAL and\n> related macros.\n...\n> This patch eliminates all those headers, defining the macros directly\n> in math.h.  For GCC 3.3 and later, the built-in functions are used as\n> now.  For other compilers, a large constant 1e10000 (with appropriate\n> suffix) is used.  This is like the fallback for GCC 2.96 and later,\n> but without using hex floats (which have no apparent advantage here).\n\nThis seems a good change to me, but I would like to propose better\ncommentary in math.h, so that people unfamiliar with the requirements\nof C90 + IEEE754 that make the fallback workable are pointed in the\nright direction: instead of\n\n> +/* Value returned on overflow.  On all IEEE754 machines, this is\n> +   +Infinity.  */\n\nsuggested wording is\n\n/* Value returned on overflow; with IEEE 754 floating point, this is\n   +Infinity, otherwise the largest representable positive value.\n\n   GCC >=3.3 and compatible compilers provide an intrinsic function,\n   usable in constant expressions, that gives this value.  Otherwise\n   use a numeric constant larger than the largest representable finite\n   value in any supported floating-point format; in the normal\n   rounding mode, ISO C requires this to be rounded to +Infinity, if\n   it exists, or else to the largest representable positive value.\n   (The intrinsic function is preferred because it will not produce\n   warnings about overflow and is not affected by rounding mode.)  */\n\nzw","headers":{"Return-Path":"<libc-alpha-return-83952-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-83952-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"wbSjzpUS\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjpHZ2Z95z9s7F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 02:49:14 +1000 (AEST)","(qmail 73015 invoked by alias); 31 Aug 2017 16:49:07 -0000","(qmail 73004 invoked by uid 89); 31 Aug 2017 16:49:06 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc:content-type; q=dns; s=default; b=QeFG\n\tH+RJ51hw/Xak98Vh0NWhRA0Xnaje9oqzYVBxhLow3XwmfmXeCVDX3ZRDiKyTu8us\n\t3Iuu1Pgpnoe94Ea1IkqCyLRHvM2gFBw+eMSBwt8Sc00/54JZEVKlBg+zNe99mVx+\n\tz1O1tobJ5B0QIZ8YCOzVc9DgXk2PRIrAUQgDqWE=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc:content-type; s=default; bh=6wJJ+17kXr\n\tezuq1qPCbtIztBxaM=; b=wbSjzpUSWEWf6DmCcwQb8KBhSmvfRPr3VHT3lcJG0+\n\tZRvPBbNqLQPkcFXK/vT4WgH9R92Z+nMrFGmPdkV5pbdYW0trP4z5uJ4SQWvk3+W1\n\t65RrI0oZsU99grYRkTsEzgcpIXcJmYG9Enl1d5gR0ILLpZlPE7+B97pkzOKmLtbY\n\tY=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-1.5 required=5.0 tests=AWL, BAYES_00,\n\tRCVD_IN_SORBS_SPAM, RP_MATCHES_RCVD, SPF_PASS,\n\tURIBL_RED autolearn=no version=3.3.2 spammy=usable","X-HELO":"mailbackend.panix.com","X-Gm-Message-State":"AHPjjUjUL3k+tGmbMXYXTSpL0Xu/AD5tiXy2wqseoXx/yBhAHmEP8KUF\n\t0hbZ7hSkec/9aHUBYf1uiUcXRWgqXQ==","X-Google-Smtp-Source":"ADKCNb7mfmLlTx2H4ZJu3aqFTssmHCM6ToMM7KJGqbS2A1S7WKD4rEBpzGxCoXxTW3PYUAqusv66lpZNfql6E6mA6wk=","X-Received":"by 10.36.1.195 with SMTP id 186mr1441200itk.34.1504198134307;\n\tThu, 31 Aug 2017 09:48:54 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<alpine.DEB.2.20.1708311551080.24662@digraph.polyomino.org.uk>","References":"<alpine.DEB.2.20.1708311551080.24662@digraph.polyomino.org.uk>","From":"Zack Weinberg <zackw@panix.com>","Date":"Thu, 31 Aug 2017 12:48:53 -0400","X-Gmail-Original-Message-ID":"<CAKCAbMhj_gmveaW6G-sj=vPzr30N3m_+hb-0TtFYzd9v4bCptw@mail.gmail.com>","Message-ID":"<CAKCAbMhj_gmveaW6G-sj=vPzr30N3m_+hb-0TtFYzd9v4bCptw@mail.gmail.com>","Subject":"Re: Simplify HUGE_VAL definitions [committed]","To":"Joseph Myers <joseph@codesourcery.com>","Cc":"GNU C Library <libc-alpha@sourceware.org>","Content-Type":"text/plain; charset=\"UTF-8\""}},{"id":1761187,"web_url":"http://patchwork.ozlabs.org/comment/1761187/","msgid":"<alpine.DEB.2.20.1708311651540.24662@digraph.polyomino.org.uk>","list_archive_url":null,"date":"2017-08-31T16:53:23","subject":"Re: Simplify HUGE_VAL definitions [committed]","submitter":{"id":4349,"url":"http://patchwork.ozlabs.org/api/people/4349/","name":"Joseph Myers","email":"joseph@codesourcery.com"},"content":"On Thu, 31 Aug 2017, Zack Weinberg wrote:\n\n> > +/* Value returned on overflow.  On all IEEE754 machines, this is\n> > +   +Infinity.  */\n> \n> suggested wording is\n> \n> /* Value returned on overflow; with IEEE 754 floating point, this is\n>    +Infinity, otherwise the largest representable positive value.\n> \n>    GCC >=3.3 and compatible compilers provide an intrinsic function,\n>    usable in constant expressions, that gives this value.  Otherwise\n>    use a numeric constant larger than the largest representable finite\n>    value in any supported floating-point format; in the normal\n>    rounding mode, ISO C requires this to be rounded to +Infinity, if\n>    it exists, or else to the largest representable positive value.\n>    (The intrinsic function is preferred because it will not produce\n>    warnings about overflow and is not affected by rounding mode.)  */\n\n\"the rounding mode\", in the last line.  OK with that change.","headers":{"Return-Path":"<libc-alpha-return-83953-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-83953-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"XafUcoKk\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xjpNt5yGvz9s7F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 02:53:50 +1000 (AEST)","(qmail 119502 invoked by alias); 31 Aug 2017 16:53:44 -0000","(qmail 119014 invoked by uid 89); 31 Aug 2017 16:53:43 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:date:from:to:cc:subject:in-reply-to:message-id\n\t:references:mime-version:content-type; q=dns; s=default; b=Ome+K\n\tFFVf0XLoXZl9V1+GKGnz5YdYOdrVIKyPpLIEzUt/TJCPPlB1RQOZJnuJaCTyY0gZ\n\thVmlvxVSx9s+IZuYjDzynUDF8uoCxGElk/PsEVSZDgG8zt5sX46HerNFYrJxfwZY\n\tLEq8NEIeSv5bNoNMiTeCDzdhnhY7CFVGLFoNms=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:date:from:to:cc:subject:in-reply-to:message-id\n\t:references:mime-version:content-type; s=default; bh=EV1zU2smsqH\n\tVHt9nY3YaEJpYaJ4=; b=XafUcoKkr5i8kb+UkapKEq0jv++Bm8gYp8Clmh9Xm0p\n\txzvcZaeB2kEIiB39pUZXAEW2WfigGh9eGHJSh8hk53GcMST3DEr5wQd1Jl6+cza6\n\tZIot6o23HMQxBFfowkCdpxTpw6Qv3MAa2OlZAorQ61+K8cJDLSFwD3T9l2Z2IO1o\n\t=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-2.0 required=5.0 tests=AWL, BAYES_00,\n\tRCVD_IN_DNSWL_NONE, SPF_PASS,\n\tURIBL_RED autolearn=ham version=3.3.2 spammy=usable","X-HELO":"relay1.mentorg.com","Date":"Thu, 31 Aug 2017 16:53:23 +0000","From":"Joseph Myers <joseph@codesourcery.com>","To":"Zack Weinberg <zackw@panix.com>","CC":"GNU C Library <libc-alpha@sourceware.org>","Subject":"Re: Simplify HUGE_VAL definitions [committed]","In-Reply-To":"<CAKCAbMhj_gmveaW6G-sj=vPzr30N3m_+hb-0TtFYzd9v4bCptw@mail.gmail.com>","Message-ID":"<alpine.DEB.2.20.1708311651540.24662@digraph.polyomino.org.uk>","References":"<alpine.DEB.2.20.1708311551080.24662@digraph.polyomino.org.uk>\n\t<CAKCAbMhj_gmveaW6G-sj=vPzr30N3m_+hb-0TtFYzd9v4bCptw@mail.gmail.com>","User-Agent":"Alpine 2.20 (DEB 67 2015-01-07)","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"US-ASCII\"","X-ClientProxiedBy":"svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To\n\tsvr-ies-mbx-01.mgc.mentorg.com (139.181.222.1)"}},{"id":1761609,"web_url":"http://patchwork.ozlabs.org/comment/1761609/","msgid":"<0a429628-dfbc-9eaf-4e19-26d9cfa22bde@panix.com>","list_archive_url":null,"date":"2017-09-01T11:41:54","subject":"Re: Simplify HUGE_VAL definitions [committed]","submitter":{"id":65878,"url":"http://patchwork.ozlabs.org/api/people/65878/","name":"Zack Weinberg","email":"zackw@panix.com"},"content":"On 08/31/2017 12:53 PM, Joseph Myers wrote:\n> On Thu, 31 Aug 2017, Zack Weinberg wrote:\n>>\n>>    Otherwise use a numeric constant larger than the largest\n>>    representable finite value in any supported floating-point\n>>    format; in the normal rounding mode, ISO C requires this to be\n>>    rounded to +Infinity, if it exists, or else to the largest\n>>    representable positive value.\n\nHang on, is this actually true?  N1570 §6.4.4.2p3 says\n\n# ... For decimal floating constants, and also for hexadecimal\n# floating constants when FLT_RADIX is not a power of 2, the result is\n# either the nearest representable value, or the larger or smaller\n# representable value immediately adjacent to the nearest\n# representable value, chosen in an implementation-defined manner.\n\nwhich would appear to license 1e10000 to be converted to either +Inf\nor DBL_MAX regardless of rounding mode.\n\n(Same wording in C99.)\n\nzw","headers":{"Return-Path":"<libc-alpha-return-84008-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84008-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"ZWOyNUKV\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xkHQk6xhRz9sRV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 21:42:06 +1000 (AEST)","(qmail 35760 invoked by alias); 1 Sep 2017 11:42:00 -0000","(qmail 35695 invoked by uid 89); 1 Sep 2017 11:41:58 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:subject:to:cc:references:from:message-id:date\n\t:mime-version:in-reply-to:content-type\n\t:content-transfer-encoding; q=dns; s=default; b=ywWvQfSA9COs2xAP\n\tn3Dkk114D0wlUsIRn8QZ8PRuvQoWzVrm5D187+x/aie2iBj0BBCm6hlSthVJw5ai\n\tVFbI25+5LLdN9bxExCmVr+BQuFshbdco0oEuTaDzfEMG4ZFQACHoQIhV+Ucdr5bA\n\tudY7Me3L8SWW1/NyB5zq44G5JLA=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:subject:to:cc:references:from:message-id:date\n\t:mime-version:in-reply-to:content-type\n\t:content-transfer-encoding; s=default; bh=D8M6hfsrYfd7DfRXFRIVIY\n\t3RV/k=; b=ZWOyNUKVqsEg+MLpOWr33xhUTIIebkVm5ZqmYyvVYv8vHvP6sp8MM+\n\tiHUoAokYYRVjOVDluhdFgFbSOZ3B+UVOWlzAnQujm+iIgMpjF4E0PzM71Q7wWL40\n\t8Yszf48YRBWVnGCyS7LnltFh7U8KTCFz+2n0nyDivH+AcITr8/Cz4=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-2.2 required=5.0 tests=AWL, BAYES_00,\n\tFREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_SORBS_SPAM,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=H*M:dfbc,\n\tHContent-Transfer-Encoding:8bit","X-HELO":"mail-qt0-f181.google.com","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:to:cc:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=EG84NYLoNeebAioanCcXcImaEMWGncb0uhWPX468a2U=;\n\tb=lUf4Pwma0+DFcJxrM3GeCDTfHQcxQFGINhN33+EfwJMJa5Dy5vwm1TSQ4n85JkjZ+W\n\t5xRwhvCHsHkapv6krhqp8wVSkBSewR1mrzYPisA7NKkFRInxd1LyZS34FfTXF9NKDJkX\n\tQnekqxDrzoa9FJz/VICaIWy3TJBe95rPZDvXrEoxgpTl/bY6qfc11TXAd45V6AIizEZk\n\tSN9gfYYhPyWCh57CHVTFvH30HOvoioO8AbOyfDtaiGqysoYV6AU+2BWrCHCmGv3HztJw\n\tSB9jwu4kvs+VjqWWloTsZPfjxAoLzTpwcptIaODHPnKVnlE1cqHzxaRzM2Brmhb/nd1g\n\tXpcA==","X-Gm-Message-State":"AHPjjUh1dajNY/JiVGpkotouJcB5m2ADSqhES20vYeMDwss9XAluJ0Gw\n\tsBrud4k1b5DH90whUwg=","X-Google-Smtp-Source":"ADKCNb6oldbQ5vJA1xiz1GxyJT4WFKMl0Fy/k61VflS1hX/qQIAqAjPQjNaRHmsuzWpvCJCmdh5+Sw==","X-Received":"by 10.200.22.34 with SMTP id p31mr2251393qtj.310.1504266115581; \n\tFri, 01 Sep 2017 04:41:55 -0700 (PDT)","Subject":"Re: Simplify HUGE_VAL definitions [committed]","To":"Joseph Myers <joseph@codesourcery.com>","Cc":"GNU C Library <libc-alpha@sourceware.org>","References":"<alpine.DEB.2.20.1708311551080.24662@digraph.polyomino.org.uk>\n\t<CAKCAbMhj_gmveaW6G-sj=vPzr30N3m_+hb-0TtFYzd9v4bCptw@mail.gmail.com>\n\t<alpine.DEB.2.20.1708311651540.24662@digraph.polyomino.org.uk>","From":"Zack Weinberg <zackw@panix.com>","Message-ID":"<0a429628-dfbc-9eaf-4e19-26d9cfa22bde@panix.com>","Date":"Fri, 1 Sep 2017 07:41:54 -0400","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<alpine.DEB.2.20.1708311651540.24662@digraph.polyomino.org.uk>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"8bit"}},{"id":1761629,"web_url":"http://patchwork.ozlabs.org/comment/1761629/","msgid":"<alpine.DEB.2.20.1709011203130.9487@digraph.polyomino.org.uk>","list_archive_url":null,"date":"2017-09-01T12:04:18","subject":"Re: Simplify HUGE_VAL definitions [committed]","submitter":{"id":4349,"url":"http://patchwork.ozlabs.org/api/people/4349/","name":"Joseph Myers","email":"joseph@codesourcery.com"},"content":"On Fri, 1 Sep 2017, Zack Weinberg wrote:\n\n> On 08/31/2017 12:53 PM, Joseph Myers wrote:\n> > On Thu, 31 Aug 2017, Zack Weinberg wrote:\n> >>\n> >>    Otherwise use a numeric constant larger than the largest\n> >>    representable finite value in any supported floating-point\n> >>    format; in the normal rounding mode, ISO C requires this to be\n> >>    rounded to +Infinity, if it exists, or else to the largest\n> >>    representable positive value.\n> \n> Hang on, is this actually true?  N1570 §6.4.4.2p3 says\n> \n> # ... For decimal floating constants, and also for hexadecimal\n> # floating constants when FLT_RADIX is not a power of 2, the result is\n> # either the nearest representable value, or the larger or smaller\n> # representable value immediately adjacent to the nearest\n> # representable value, chosen in an implementation-defined manner.\n> \n> which would appear to license 1e10000 to be converted to either +Inf\n> or DBL_MAX regardless of rounding mode.\n\nAnnex F requires conversions of constants (with at most DECIMAL_DIG \ndigits) to be to-nearest.  (TS 18661-1 adds the FENV_ROUND pragma to \nchoose a different rounding mode for them and for certain operations.)","headers":{"Return-Path":"<libc-alpha-return-84009-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84009-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"KMJZ8orW\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xkHwj0B8sz9s7M\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 22:04:36 +1000 (AEST)","(qmail 54576 invoked by alias); 1 Sep 2017 12:04:29 -0000","(qmail 54478 invoked by uid 89); 1 Sep 2017 12:04:28 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:date:from:to:cc:subject:in-reply-to:message-id\n\t:references:mime-version:content-type; q=dns; s=default; b=P2awd\n\tnn+eyqSWHIO6f12WRw42dJWcsy7nRbgMV5LaMzD3ckueUNib+yD+YZj+HtOePzDe\n\twJ3ILRn4IS8j4SWYMfUhD8ugoWUiOw4gduKpbjcAa7zVQs2d74iN2yt9kHX11T4P\n\t1R77FQ7X6WJBRxiC3P3IM2oDj3dfPYJHq8j/ak=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:date:from:to:cc:subject:in-reply-to:message-id\n\t:references:mime-version:content-type; s=default; bh=AZ4Qe/Gda+0\n\tRMjD9ZKg50lAoXjU=; b=KMJZ8orWOjbXFD9v0bu7V9uQUnJKRni0Ecdd7hpUNXb\n\txP5mYNmo4rgJB84ih6wclYSMKsE5Gm014yBFWojnWMSFhfs28/Zs0B3F8cxQPuNh\n\tZy/qL1Fqe+jgkePs+nayrQjNwQ12zvegnYQgBJlBj2USTaj8H6bt++sC1ciloPM8\n\t=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-2.0 required=5.0 tests=AWL, BAYES_00,\n\tRCVD_IN_DNSWL_NONE, SPF_PASS,\n\tURIBL_RED autolearn=ham version=3.3.2 spammy=H*c:HHHH","X-HELO":"relay1.mentorg.com","Date":"Fri, 1 Sep 2017 12:04:18 +0000","From":"Joseph Myers <joseph@codesourcery.com>","To":"Zack Weinberg <zackw@panix.com>","CC":"GNU C Library <libc-alpha@sourceware.org>","Subject":"Re: Simplify HUGE_VAL definitions [committed]","In-Reply-To":"<0a429628-dfbc-9eaf-4e19-26d9cfa22bde@panix.com>","Message-ID":"<alpine.DEB.2.20.1709011203130.9487@digraph.polyomino.org.uk>","References":"<alpine.DEB.2.20.1708311551080.24662@digraph.polyomino.org.uk>\n\t<CAKCAbMhj_gmveaW6G-sj=vPzr30N3m_+hb-0TtFYzd9v4bCptw@mail.gmail.com>\n\t<alpine.DEB.2.20.1708311651540.24662@digraph.polyomino.org.uk>\n\t<0a429628-dfbc-9eaf-4e19-26d9cfa22bde@panix.com>","User-Agent":"Alpine 2.20 (DEB 67 2015-01-07)","MIME-Version":"1.0","Content-Type":"multipart/mixed;\n\tboundary=\"-1152306461-1637260039-1504267458=:9487\"","X-ClientProxiedBy":"svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To\n\tsvr-ies-mbx-01.mgc.mentorg.com (139.181.222.1)"}},{"id":1761653,"web_url":"http://patchwork.ozlabs.org/comment/1761653/","msgid":"<CAKCAbMjzxFzXHREsfuVN1TA-Bp1-Dgfaz6_b09E7Ue3NsHtF5w@mail.gmail.com>","list_archive_url":null,"date":"2017-09-01T12:43:09","subject":"Re: Simplify HUGE_VAL definitions [committed]","submitter":{"id":65878,"url":"http://patchwork.ozlabs.org/api/people/65878/","name":"Zack Weinberg","email":"zackw@panix.com"},"content":"On Fri, Sep 1, 2017 at 8:04 AM, Joseph Myers <joseph@codesourcery.com> wrote:\n> On Fri, 1 Sep 2017, Zack Weinberg wrote:\n>> On 08/31/2017 12:53 PM, Joseph Myers wrote:\n>> > On Thu, 31 Aug 2017, Zack Weinberg wrote:\n>> >>\n>> >>    Otherwise use a numeric constant larger than the largest\n>> >>    representable finite value in any supported floating-point\n>> >>    format; in the normal rounding mode, ISO C requires this to be\n>> >>    rounded to +Infinity, if it exists, or else to the largest\n>> >>    representable positive value.\n>>\n>> Hang on, is this actually true?  N1570 §6.4.4.2p3 says\n>>\n>> # ... For decimal floating constants, and also for hexadecimal\n>> # floating constants when FLT_RADIX is not a power of 2, the result is\n>> # either the nearest representable value, or the larger or smaller\n>> # representable value immediately adjacent to the nearest\n>> # representable value, chosen in an implementation-defined manner.\n>>\n>> which would appear to license 1e10000 to be converted to either +Inf\n>> or DBL_MAX regardless of rounding mode.\n>\n> Annex F requires conversions of constants (with at most DECIMAL_DIG\n> digits) to be to-nearest.  (TS 18661-1 adds the FENV_ROUND pragma to\n> choose a different rounding mode for them and for certain operations.)\n\nYes, but for any constant greater than <type>_MAX, <type>_MAX is\narguably nearer to that constant than +Infinity is.\n\nzw","headers":{"Return-Path":"<libc-alpha-return-84012-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84012-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"gqITmU7t\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xkJnS2p7gz9s7c\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 22:43:24 +1000 (AEST)","(qmail 73189 invoked by alias); 1 Sep 2017 12:43:18 -0000","(qmail 73136 invoked by uid 89); 1 Sep 2017 12:43:18 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc:content-type\n\t:content-transfer-encoding; q=dns; s=default; b=PgpzSUIeuxkIYaP0\n\tSgVdXiB9Ci1gUIibeGcm0Y+FNyNIpdafvoXL/jD7GkvvXut4+60P6/UzMTh/CjMM\n\tmyb2py7K2KOEbndRqPUK6yVn25GZmjNDrBclqSBdbPpaPJQ8H1RMo7X74fxo8pVZ\n\t+H11hbBfE8yukiG/q8nzi27WEB0=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc:content-type\n\t:content-transfer-encoding; s=default; bh=MkhcOzfzHyGFRpoDz0zu8o\n\tftnSE=; b=gqITmU7tF0uDQFgKIlUA0QJ5HLwHsuYGZuaLeX6JMjxK5DgVLjWQ/1\n\t0pFHmU3Hcl1RqwfpFIHUU3WlPSWM4c4Sh3GzhKzWAOo2wCg+d8bDYhtnvKLjXy7Y\n\t0PdBISddnE+fnvVK8zzkAPU9KGH5OyfmPNp3zxp+p8+InXi652fks=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-1.5 required=5.0 tests=AWL, BAYES_00,\n\tRCVD_IN_SORBS_SPAM, RP_MATCHES_RCVD, SPF_PASS,\n\tURIBL_RED autolearn=no version=3.3.2 spammy=nearer","X-HELO":"mailbackend.panix.com","X-Gm-Message-State":"AHPjjUgmj8c8thdUksvI5+p4NNY+HB7she0lsmMpNUcK6Bozn9/9vraA\n\tJPbsZ46B5I0WondoShbkyx7MKIjRmw==","X-Google-Smtp-Source":"ADKCNb4xifizn/pwxlA7MVUhkTpPYVfGvUeZaX4f/ZMRF1evDlVi+YtBBgi932cWaFbYHKi5+PT2RirmfbCWiaCM3dU=","X-Received":"by 10.36.9.206 with SMTP id 197mr504425itm.77.1504269790491; Fri,\n\t01 Sep 2017 05:43:10 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<alpine.DEB.2.20.1709011203130.9487@digraph.polyomino.org.uk>","References":"<alpine.DEB.2.20.1708311551080.24662@digraph.polyomino.org.uk>\n\t<CAKCAbMhj_gmveaW6G-sj=vPzr30N3m_+hb-0TtFYzd9v4bCptw@mail.gmail.com>\n\t<alpine.DEB.2.20.1708311651540.24662@digraph.polyomino.org.uk>\n\t<0a429628-dfbc-9eaf-4e19-26d9cfa22bde@panix.com>\n\t<alpine.DEB.2.20.1709011203130.9487@digraph.polyomino.org.uk>","From":"Zack Weinberg <zackw@panix.com>","Date":"Fri, 1 Sep 2017 08:43:09 -0400","X-Gmail-Original-Message-ID":"<CAKCAbMjzxFzXHREsfuVN1TA-Bp1-Dgfaz6_b09E7Ue3NsHtF5w@mail.gmail.com>","Message-ID":"<CAKCAbMjzxFzXHREsfuVN1TA-Bp1-Dgfaz6_b09E7Ue3NsHtF5w@mail.gmail.com>","Subject":"Re: Simplify HUGE_VAL definitions [committed]","To":"Joseph Myers <joseph@codesourcery.com>","Cc":"GNU C Library <libc-alpha@sourceware.org>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable"}},{"id":1761678,"web_url":"http://patchwork.ozlabs.org/comment/1761678/","msgid":"<alpine.DEB.2.20.1709011323000.9487@digraph.polyomino.org.uk>","list_archive_url":null,"date":"2017-09-01T13:24:59","subject":"Re: Simplify HUGE_VAL definitions [committed]","submitter":{"id":4349,"url":"http://patchwork.ozlabs.org/api/people/4349/","name":"Joseph Myers","email":"joseph@codesourcery.com"},"content":"On Fri, 1 Sep 2017, Zack Weinberg wrote:\n\n> > Annex F requires conversions of constants (with at most DECIMAL_DIG\n> > digits) to be to-nearest.  (TS 18661-1 adds the FENV_ROUND pragma to\n> > choose a different rounding mode for them and for certain operations.)\n> \n> Yes, but for any constant greater than <type>_MAX, <type>_MAX is\n> arguably nearer to that constant than +Infinity is.\n\nThe IEEE rounding modes (all of them) define overflow on the basis of \nwhether the result with normal precision but infinite exponent range would \nhave an exponent that's too big (and in the case of overflow, the rounded \nresult is determined by the rounding mode, so +Inf for to-nearest).","headers":{"Return-Path":"<libc-alpha-return-84015-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84015-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"hlLyuvw7\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xkKjv0965z9t32\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 23:25:22 +1000 (AEST)","(qmail 26653 invoked by alias); 1 Sep 2017 13:25:15 -0000","(qmail 26642 invoked by uid 89); 1 Sep 2017 13:25:15 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:date:from:to:cc:subject:in-reply-to:message-id\n\t:references:mime-version:content-type; q=dns; s=default; b=W8vGH\n\thnuIlYJezoNEFub1exhrB11sIYO52HMZjHg3AyA6IrUeRmYkzaGSiwIIh87HPa8E\n\tOtaSbyIal9dGWYFEeBbcDn4vmn+YXuFqKndjTy3EvflmLceQRikbHxtdHq7FGR0I\n\tSQvdU62uLIZCdejwYqkuCyE9Rr6P++Cz9QJlO4=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:date:from:to:cc:subject:in-reply-to:message-id\n\t:references:mime-version:content-type; s=default; bh=rTIOVnbO5IH\n\tWrwS2R4BGkoQXZSY=; b=hlLyuvw7XJZbDQlCB5Ho3NZiwSc7ktmFq7nj1VBya1l\n\tFmcVb5ChLUCkkIYCDKxBjPxIwak0hurFavz+qTWJWjxxXPHRHNvAfSbewyzlAeKv\n\twyaIXZRHCfIzbgfdmW/+jcKPnaeTmllg6tF27NDA4azk3RmSCBIvOSOpWFXww9PU\n\t=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-2.0 required=5.0 tests=AWL, BAYES_00,\n\tRCVD_IN_DNSWL_NONE, SPF_PASS,\n\tURIBL_RED autolearn=ham version=3.3.2 spammy=nearer","X-HELO":"relay1.mentorg.com","Date":"Fri, 1 Sep 2017 13:24:59 +0000","From":"Joseph Myers <joseph@codesourcery.com>","To":"Zack Weinberg <zackw@panix.com>","CC":"GNU C Library <libc-alpha@sourceware.org>","Subject":"Re: Simplify HUGE_VAL definitions [committed]","In-Reply-To":"<CAKCAbMjzxFzXHREsfuVN1TA-Bp1-Dgfaz6_b09E7Ue3NsHtF5w@mail.gmail.com>","Message-ID":"<alpine.DEB.2.20.1709011323000.9487@digraph.polyomino.org.uk>","References":"<alpine.DEB.2.20.1708311551080.24662@digraph.polyomino.org.uk>\n\t<CAKCAbMhj_gmveaW6G-sj=vPzr30N3m_+hb-0TtFYzd9v4bCptw@mail.gmail.com>\n\t<alpine.DEB.2.20.1708311651540.24662@digraph.polyomino.org.uk>\n\t<0a429628-dfbc-9eaf-4e19-26d9cfa22bde@panix.com>\n\t<alpine.DEB.2.20.1709011203130.9487@digraph.polyomino.org.uk>\n\t<CAKCAbMjzxFzXHREsfuVN1TA-Bp1-Dgfaz6_b09E7Ue3NsHtF5w@mail.gmail.com>","User-Agent":"Alpine 2.20 (DEB 67 2015-01-07)","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"US-ASCII\"","X-ClientProxiedBy":"svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To\n\tsvr-ies-mbx-01.mgc.mentorg.com (139.181.222.1)"}},{"id":1761715,"web_url":"http://patchwork.ozlabs.org/comment/1761715/","msgid":"<68de3d6e-7900-96a4-bc13-c5eff05fda7f@panix.com>","list_archive_url":null,"date":"2017-09-01T13:56:39","subject":"Re: Simplify HUGE_VAL definitions [committed]","submitter":{"id":65878,"url":"http://patchwork.ozlabs.org/api/people/65878/","name":"Zack Weinberg","email":"zackw@panix.com"},"content":"On 09/01/2017 09:24 AM, Joseph Myers wrote:\n> On Fri, 1 Sep 2017, Zack Weinberg wrote:\n> \n>>> Annex F requires conversions of constants (with at most DECIMAL_DIG\n>>> digits) to be to-nearest.  (TS 18661-1 adds the FENV_ROUND pragma to\n>>> choose a different rounding mode for them and for certain operations.)\n>>\n>> Yes, but for any constant greater than <type>_MAX, <type>_MAX is\n>> arguably nearer to that constant than +Infinity is.\n> \n> The IEEE rounding modes (all of them) define overflow on the basis of \n> whether the result with normal precision but infinite exponent range would \n> have an exponent that's too big (and in the case of overflow, the rounded \n> result is determined by the rounding mode, so +Inf for to-nearest).\n\nOK, I think I get it.\n\nOne more problem, which I should have thought to check earlier: 1e10000L\nisn't big enough if long double is 128 bits wide (which it actually\nappears to be on this computer):\n\n$ gcc -E -dM -xc - < /dev/null | grep -E '(DBL|LDBL|FLT[0-9]*)_MAX_EXP'\n#define __LDBL_MAX_EXP__ 16384\n#define __DBL_MAX_EXP__ 1024\n#define __FLT32_MAX_EXP__ 128\n#define __FLT128_MAX_EXP__ 16384\n#define __FLT_MAX_EXP__ 128\n#define __FLT64_MAX_EXP__ 1024\n\nSo I propose this patch (not yet tested):\n\n--- a/math/math.h\n+++ b/math/math.h\n@@ -37,20 +37,25 @@ __BEGIN_DECLS\n /* Gather machine dependent type support.  */\n #include <bits/floatn.h>\n\n-/* Value returned on overflow.  On all IEEE754 machines, this is\n-   +Infinity.  */\n+/* Value returned on overflow.  With IEEE 754 floating point, this is\n+   +Infinity, otherwise the largest representable positive value.  */\n #if __GNUC_PREREQ (3, 3)\n # define HUGE_VAL (__builtin_huge_val ())\n #else\n-# define HUGE_VAL 1e10000\n+/* This may provoke compiler warnings, and may not be rounded to\n+   +Infinity in all IEEE 754 rounding modes, but is the best that\n+   can be done in ISO C while remaining a constant expression.\n+   100,000 is greater than the maximum exponent for all supported\n+   floating-point formats and widths.  */\n+# define HUGE_VAL 1e100000\n #endif\n #ifdef __USE_ISOC99\n # if __GNUC_PREREQ (3, 3)\n #  define HUGE_VALF (__builtin_huge_valf ())\n #  define HUGE_VALL (__builtin_huge_vall ())\n # else\n-#  define HUGE_VALF 1e10000f\n-#  define HUGE_VALL 1e10000L\n+#  define HUGE_VALF 1e100000f\n+#  define HUGE_VALL 1e100000L\n # endif\n #endif\n #if __HAVE_FLOAT128 && __GLIBC_USE (IEC_60559_TYPES_EXT)","headers":{"Return-Path":"<libc-alpha-return-84020-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84020-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"dTc8+1Rv\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xkLQB5Yw5z9s7F\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri,  1 Sep 2017 23:56:50 +1000 (AEST)","(qmail 64475 invoked by alias); 1 Sep 2017 13:56:44 -0000","(qmail 64280 invoked by uid 89); 1 Sep 2017 13:56:44 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:subject:to:cc:references:from:message-id:date\n\t:mime-version:in-reply-to:content-type\n\t:content-transfer-encoding; q=dns; s=default; b=IghuCDSuWJMDHLff\n\tFXzEtOUa1I8cM18ekLrgxGqv6e+FoJdtj6kva5d1oPKgHkW7uuDILnpggb26GrQW\n\tHxo4IbRpOuxP/pawrFRsInleSN2icaII8XfAfh36zzyTZmUg4YV3S8VICGYgas3M\n\teZ3vU7eyazuJ0v8gxWvaS+38zwk=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:subject:to:cc:references:from:message-id:date\n\t:mime-version:in-reply-to:content-type\n\t:content-transfer-encoding; s=default; bh=w3kZb6EHAZZRgjvpQjZ/Ql\n\tbblJ0=; b=dTc8+1RvdKaOEeTuIfrJ79TFT03iM4wzO6y8pXEDT9VqETLV3JfCmC\n\tM3iYspnDsvQzENwktmv6LNHWxLFC9Ma4OWUqTIY6RVIXyfHIY8vl+g8pnOrLH8Oi\n\tcRKVX/4qzcojlCIraofEnTnEXQAWlEoTkbJbLEADsE0u9SpirDiSo=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-10.5 required=5.0 tests=AWL, BAYES_00,\n\tFREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE,\n\tRCVD_IN_SORBS_SPAM,\n\tSPF_PASS autolearn=ham version=3.3.2 spammy=100, 000, H*M:bc13","X-HELO":"mail-qk0-f180.google.com","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:subject:to:cc:references:from:message-id:date\n\t:user-agent:mime-version:in-reply-to:content-language\n\t:content-transfer-encoding;\n\tbh=oD8lu0WHCRs5Lm8AU1DFyPG2KuS3vzsPskGjRpzJcRE=;\n\tb=gngcWsSDl6Epz3egHB3lqpMbGmk2vxfBd7eJTQpgKn0QeYZ8xtHA5qTisY9OLshd9r\n\tROnl2Pvk3MUNfndiMeEoDmrdZJLrCEzkfF8iEXdBifxw1RrFhf0EpXPIm5DQJqd+ZVzK\n\tpW9jlnoI88IyroRKtjd17C9bnaQPmdSZFZZvehb2vzCAX4MSVJIhTFcpnLLQdPiJMvVt\n\tVZnNe86Xzj0tsiQHwuS54WDZHRkbQI4f+O4puJ0jXHfsn3Hk9G+mnHVGk56H+JeA96CN\n\td/kj33I34Sro5f56vgDXi9ZnIuINzPcwROUfs7FFpUV93H9rSCoBCJnmnkGcKEogsAnR\n\tdrZg==","X-Gm-Message-State":"AHPjjUilsN6Oz8L1pNhjB0fVWgok+oAFW/2zQVbCeClLTtDr41O5BPWD\n\tCcNgnmWg+FTSyQfqtkk=","X-Google-Smtp-Source":"ADKCNb6Akr+kXkn28pkoQZ9JKBkb2kFeuDgsk3E0Gj4Am2cRlC+hzy3n25sPvoVhqHGXSFT8PoDwpQ==","X-Received":"by 10.55.217.150 with SMTP id q22mr2472080qkl.343.1504274200853; \n\tFri, 01 Sep 2017 06:56:40 -0700 (PDT)","Subject":"Re: Simplify HUGE_VAL definitions [committed]","To":"Joseph Myers <joseph@codesourcery.com>","Cc":"GNU C Library <libc-alpha@sourceware.org>","References":"<alpine.DEB.2.20.1708311551080.24662@digraph.polyomino.org.uk>\n\t<CAKCAbMhj_gmveaW6G-sj=vPzr30N3m_+hb-0TtFYzd9v4bCptw@mail.gmail.com>\n\t<alpine.DEB.2.20.1708311651540.24662@digraph.polyomino.org.uk>\n\t<0a429628-dfbc-9eaf-4e19-26d9cfa22bde@panix.com>\n\t<alpine.DEB.2.20.1709011203130.9487@digraph.polyomino.org.uk>\n\t<CAKCAbMjzxFzXHREsfuVN1TA-Bp1-Dgfaz6_b09E7Ue3NsHtF5w@mail.gmail.com>\n\t<alpine.DEB.2.20.1709011323000.9487@digraph.polyomino.org.uk>","From":"Zack Weinberg <zackw@panix.com>","Message-ID":"<68de3d6e-7900-96a4-bc13-c5eff05fda7f@panix.com>","Date":"Fri, 1 Sep 2017 09:56:39 -0400","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.3.0","MIME-Version":"1.0","In-Reply-To":"<alpine.DEB.2.20.1709011323000.9487@digraph.polyomino.org.uk>","Content-Type":"text/plain; charset=utf-8","Content-Transfer-Encoding":"8bit"}},{"id":1761748,"web_url":"http://patchwork.ozlabs.org/comment/1761748/","msgid":"<alpine.DEB.2.20.1709011452180.21790@digraph.polyomino.org.uk>","list_archive_url":null,"date":"2017-09-01T14:59:12","subject":"Re: Simplify HUGE_VAL definitions [committed]","submitter":{"id":4349,"url":"http://patchwork.ozlabs.org/api/people/4349/","name":"Joseph Myers","email":"joseph@codesourcery.com"},"content":"On Fri, 1 Sep 2017, Zack Weinberg wrote:\n\n> One more problem, which I should have thought to check earlier: 1e10000L\n> isn't big enough if long double is 128 bits wide (which it actually\n> appears to be on this computer):\n\n1e10000L is big enough.  For both x86 extended and binary128, the largest \nfinite value is just below 2^16384 (about 1.2e4932).\n\nIt's true that it wouldn't be enough for _Float128x (which must have a \nprecision of at least 128 bits and maximum exponent at least 65535; e.g. \nbinary192 would meet those requirements, binary160 wouldn't; GCC does not \nsupport _Float128x, or any such format, on any target).  But if we \nsupported such types I don't expect we'd have a HUGE_VAL fallback for them \nany more than we do for HUGE_VAL_F128.","headers":{"Return-Path":"<libc-alpha-return-84021-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84021-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"PaRSqpbl\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xkMpf3zvjz9t2d\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  2 Sep 2017 00:59:38 +1000 (AEST)","(qmail 115560 invoked by alias); 1 Sep 2017 14:59:25 -0000","(qmail 115507 invoked by uid 89); 1 Sep 2017 14:59:24 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:date:from:to:cc:subject:in-reply-to:message-id\n\t:references:mime-version:content-type; q=dns; s=default; b=CRxqM\n\tBtl/HQFtfff3Mty8eSMoQJNU2ghPY5v8LPtrI2UKQl8oZAFq4ok8fV5l4R40vMLD\n\tjloSo73fIsMvn3cHgdvxoCS97rEgzSKDRhoSeOuA8tKk2J9ND8xF4reQDOr+vNM4\n\tbNGktkH/CV7dceBCgOgadZb5Ljd42acNZdxmso=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:date:from:to:cc:subject:in-reply-to:message-id\n\t:references:mime-version:content-type; s=default; bh=6YG4CQRLCP8\n\tjgEyeh0YasiWOdMc=; b=PaRSqpbleVm0DR0PcB8N/uoANf2MeEkHnTfgEHLF7P1\n\tKVs5HExSWbOKb1/3MAURw2OWARaJZvmlqIMNloardZWRg1gXEbBwRMThV8PLTlR0\n\tjyYM5WVG1frgtV4OVpBLwRAPUpXJEHVvNyXdTL/EUovj7+SFIDMO5IA4sOi2c7KA\n\t=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-2.0 required=5.0 tests=AWL, BAYES_00,\n\tRCVD_IN_DNSWL_NONE, SPF_PASS,\n\tURIBL_RED autolearn=ham version=3.3.2 spammy=Hx-languages-length:839,\n\tmeet","X-HELO":"relay1.mentorg.com","Date":"Fri, 1 Sep 2017 14:59:12 +0000","From":"Joseph Myers <joseph@codesourcery.com>","To":"Zack Weinberg <zackw@panix.com>","CC":"GNU C Library <libc-alpha@sourceware.org>","Subject":"Re: Simplify HUGE_VAL definitions [committed]","In-Reply-To":"<68de3d6e-7900-96a4-bc13-c5eff05fda7f@panix.com>","Message-ID":"<alpine.DEB.2.20.1709011452180.21790@digraph.polyomino.org.uk>","References":"<alpine.DEB.2.20.1708311551080.24662@digraph.polyomino.org.uk>\n\t<CAKCAbMhj_gmveaW6G-sj=vPzr30N3m_+hb-0TtFYzd9v4bCptw@mail.gmail.com>\n\t<alpine.DEB.2.20.1708311651540.24662@digraph.polyomino.org.uk>\n\t<0a429628-dfbc-9eaf-4e19-26d9cfa22bde@panix.com>\n\t<alpine.DEB.2.20.1709011203130.9487@digraph.polyomino.org.uk>\n\t<CAKCAbMjzxFzXHREsfuVN1TA-Bp1-Dgfaz6_b09E7Ue3NsHtF5w@mail.gmail.com>\n\t<alpine.DEB.2.20.1709011323000.9487@digraph.polyomino.org.uk>\n\t<68de3d6e-7900-96a4-bc13-c5eff05fda7f@panix.com>","User-Agent":"Alpine 2.20 (DEB 67 2015-01-07)","MIME-Version":"1.0","Content-Type":"text/plain; charset=\"US-ASCII\"","X-ClientProxiedBy":"svr-ies-mbx-01.mgc.mentorg.com (139.181.222.1) To\n\tsvr-ies-mbx-01.mgc.mentorg.com (139.181.222.1)"}},{"id":1761755,"web_url":"http://patchwork.ozlabs.org/comment/1761755/","msgid":"<CAKCAbMhXrXDnhyy-W8QLojRobbL+VGJq_pBdgZAn_P-yD6MNGA@mail.gmail.com>","list_archive_url":null,"date":"2017-09-01T15:18:35","subject":"Re: Simplify HUGE_VAL definitions [committed]","submitter":{"id":65878,"url":"http://patchwork.ozlabs.org/api/people/65878/","name":"Zack Weinberg","email":"zackw@panix.com"},"content":"On Fri, Sep 1, 2017 at 10:59 AM, Joseph Myers <joseph@codesourcery.com> wrote:\n> On Fri, 1 Sep 2017, Zack Weinberg wrote:\n>\n>> One more problem, which I should have thought to check earlier: 1e10000L\n>> isn't big enough if long double is 128 bits wide (which it actually\n>> appears to be on this computer):\n>\n> 1e10000L is big enough.  For both x86 extended and binary128, the largest\n> finite value is just below 2^16384 (about 1.2e4932).\n\nOh, right, I forgot *_MAX_EXP are binary.\n\nI'm checking this in instead, then.\n\nzw\n\n        * math/math.h (HUGE_VAL): Improve commentary.\n\ndiff --git a/math/math.h b/math/math.h\nindex bbc1ab9bfa..547b36d10e 100644\n--- a/math/math.h\n+++ b/math/math.h\n@@ -37,11 +37,16 @@ __BEGIN_DECLS\n /* Gather machine dependent type support.  */\n #include <bits/floatn.h>\n\n-/* Value returned on overflow.  On all IEEE754 machines, this is\n-   +Infinity.  */\n+/* Value returned on overflow.  With IEEE 754 floating point, this is\n+   +Infinity, otherwise the largest representable positive value.  */\n #if __GNUC_PREREQ (3, 3)\n # define HUGE_VAL (__builtin_huge_val ())\n #else\n+/* This may provoke compiler warnings, and may not be rounded to\n+   +Infinity in all IEEE 754 rounding modes, but is the best that can\n+   be done in ISO C while remaining a constant expression.  10,000 is\n+   greater than the maximum (decimal) exponent for all supported\n+   floating-point formats and widths.  */\n # define HUGE_VAL 1e10000\n #endif\n #ifdef __USE_ISOC99","headers":{"Return-Path":"<libc-alpha-return-84024-incoming=patchwork.ozlabs.org@sourceware.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":["patchwork-incoming@bilbo.ozlabs.org","mailing list libc-alpha@sourceware.org"],"Authentication-Results":["ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=sourceware.org\n\t(client-ip=209.132.180.131; helo=sourceware.org;\n\tenvelope-from=libc-alpha-return-84024-incoming=patchwork.ozlabs.org@sourceware.org;\n\treceiver=<UNKNOWN>)","ozlabs.org; dkim=pass (1024-bit key;\n\tsecure) header.d=sourceware.org header.i=@sourceware.org\n\theader.b=\"rn01biQR\"; dkim-atps=neutral","sourceware.org; auth=none"],"Received":["from sourceware.org (server1.sourceware.org [209.132.180.131])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xkNDm3smyz9t2Z\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat,  2 Sep 2017 01:18:48 +1000 (AEST)","(qmail 40038 invoked by alias); 1 Sep 2017 15:18:42 -0000","(qmail 40024 invoked by uid 89); 1 Sep 2017 15:18:41 -0000"],"DomainKey-Signature":"a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc:content-type; q=dns; s=default; b=QsKl\n\tGzJm6kZxu6K9xNAtEwxdeUqRyUiJNd33H0OCAoxADf9lSHZyXnCoy5pj6Zun4c0R\n\tOVqIBdYSRmJgvLc84ML7Mwue1K0ciph8kyKzjRr52SSc0cobaJ0cSgtkqqkwqn4K\n\tOJlf4dnNLkeTY9jsWmnMfhSNakLdHCyuhMjlLcA=","DKIM-Signature":"v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id\n\t:list-unsubscribe:list-subscribe:list-archive:list-post\n\t:list-help:sender:mime-version:in-reply-to:references:from:date\n\t:message-id:subject:to:cc:content-type; s=default; bh=hfdWtv66KX\n\tJvoRr7KxYxahNOHQA=; b=rn01biQRhBpJcXFNLQ+va+XkS+oK9T86MoPkPfSOYS\n\tebXqMCOJlCJGHpxf2uAlZoN7+1Kg/PZJqe9kzs67JKVhxhfj2vZW6poN23V/HvZw\n\t4OwcOVCXKFvxBY/acNXkp/5eXnz/xt6CopKmZVb0/zjL0ogGaZ5Szf3+l49Ihbwr\n\tc=","Mailing-List":"contact libc-alpha-help@sourceware.org; run by ezmlm","Precedence":"bulk","List-Id":"<libc-alpha.sourceware.org>","List-Unsubscribe":"<mailto:libc-alpha-unsubscribe-incoming=patchwork.ozlabs.org@sourceware.org>","List-Subscribe":"<mailto:libc-alpha-subscribe@sourceware.org>","List-Archive":"<http://sourceware.org/ml/libc-alpha/>","List-Post":"<mailto:libc-alpha@sourceware.org>","List-Help":"<mailto:libc-alpha-help@sourceware.org>,\n\t<http://sourceware.org/ml/#faqs>","Sender":"libc-alpha-owner@sourceware.org","X-Virus-Found":"No","X-Spam-SWARE-Status":"No, score=-24.0 required=5.0 tests=AWL, BAYES_00,\n\tGIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3,\n\tRCVD_IN_SORBS_SPAM, RP_MATCHES_RCVD, SPF_PASS,\n\tURIBL_RED autolearn=ham version=3.3.2 spammy=10, 000","X-HELO":"mailbackend.panix.com","X-Gm-Message-State":"AHPjjUjWDSiQWlD97TeO7DrpHzZlyi6Ftv5terZq6fD/NFd5GqKHUKfq\n\taukYqicuJjeMN9c8xex7mTUZBz3MFw==","X-Google-Smtp-Source":"ADKCNb46NT9s3lv3KxrHcKaqo7W6gtsmKK0RKSEnYwZzMXAHC9qZ072/QawegrUa6l1V6DJZlXu+BixWn76FXnTo+OA=","X-Received":"by 10.107.4.77 with SMTP id 74mr1934061ioe.167.1504279118002;\n\tFri, 01 Sep 2017 08:18:38 -0700 (PDT)","MIME-Version":"1.0","In-Reply-To":"<alpine.DEB.2.20.1709011452180.21790@digraph.polyomino.org.uk>","References":"<alpine.DEB.2.20.1708311551080.24662@digraph.polyomino.org.uk>\n\t<CAKCAbMhj_gmveaW6G-sj=vPzr30N3m_+hb-0TtFYzd9v4bCptw@mail.gmail.com>\n\t<alpine.DEB.2.20.1708311651540.24662@digraph.polyomino.org.uk>\n\t<0a429628-dfbc-9eaf-4e19-26d9cfa22bde@panix.com>\n\t<alpine.DEB.2.20.1709011203130.9487@digraph.polyomino.org.uk>\n\t<CAKCAbMjzxFzXHREsfuVN1TA-Bp1-Dgfaz6_b09E7Ue3NsHtF5w@mail.gmail.com>\n\t<alpine.DEB.2.20.1709011323000.9487@digraph.polyomino.org.uk>\n\t<68de3d6e-7900-96a4-bc13-c5eff05fda7f@panix.com>\n\t<alpine.DEB.2.20.1709011452180.21790@digraph.polyomino.org.uk>","From":"Zack Weinberg <zackw@panix.com>","Date":"Fri, 1 Sep 2017 11:18:35 -0400","X-Gmail-Original-Message-ID":"<CAKCAbMhXrXDnhyy-W8QLojRobbL+VGJq_pBdgZAn_P-yD6MNGA@mail.gmail.com>","Message-ID":"<CAKCAbMhXrXDnhyy-W8QLojRobbL+VGJq_pBdgZAn_P-yD6MNGA@mail.gmail.com>","Subject":"Re: Simplify HUGE_VAL definitions [committed]","To":"Joseph Myers <joseph@codesourcery.com>","Cc":"GNU C Library <libc-alpha@sourceware.org>","Content-Type":"text/plain; charset=\"UTF-8\""}}]