220 34698 <d170ed43-361a-c5df-ff46-157240760a97@westcontrol.com> article
Path: news.gmane.org!.POSTED!not-for-mail
From: David Brown <david@westcontrol.com>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: Constexpr maths functions
Date: Sun, 8 Oct 2017 12:45:06 +0200
Lines: 48
Approved: news@gmane.org
Message-ID: <d170ed43-361a-c5df-ff46-157240760a97@westcontrol.com>
References: <or7mnd$fr2$1@blaine.gmane.org>
 <01e6fcdd-3250-4017-b53a-cea48f869817@isocpp.org>
 <8c572022-0abd-6677-4b50-788651354e1e@westcontrol.com>
 <79697376-5ccd-470a-b197-ab717ae1d64a@isocpp.org>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"; format=flowed
Content-Transfer-Encoding: quoted-printable
X-Trace: blaine.gmane.org 1507459510 27963 195.159.176.226 (8 Oct 2017 10:45:10 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sun, 8 Oct 2017 10:45:10 +0000 (UTC)
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101
 Thunderbird/52.3.0
To: Niall Douglas <nialldouglas14@gmail.com>, ISO C++ Standard - Future
 Proposals <std-proposals@isocpp.org>
Original-X-From: std-proposals+bncBDP6R2XHXIARBMUD5DHAKGQEQWRZMBQ@isocpp.org Sun Oct 08 12:45:05 2017
Return-path: <std-proposals+bncBDP6R2XHXIARBMUD5DHAKGQEQWRZMBQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-lf0-f70.google.com ([209.85.215.70])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBDP6R2XHXIARBMUD5DHAKGQEQWRZMBQ@isocpp.org>)
	id 1e194v-0006E5-6Y
	for gclcip-std-proposals@m.gmane.org; Sun, 08 Oct 2017 12:45:01 +0200
Original-Received: by mail-lf0-f70.google.com with SMTP id p195sf6383806lfd.18
        for <gclcip-std-proposals@m.gmane.org>; Sun, 08 Oct 2017 03:45:08 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1507459508; cv=pass;
        d=google.com; s=arc-20160816;
        b=e4gMuWCMOk4+B19oUAjRB7j7HHcvV63m+uDyHK0tmtXYiAfWUd2hudm7j1SzBTV/rM
         3/T6p5UQUCUIbbMwmCiVJkuNsMW1tekiXQPKBlAeIzfUtKugCx5DA8+CKZnujKEYZSHJ
         9Zr4+f91n41eHcTQCx4IGu0KI6lpQcVR5PsOVvX+9nJLZCwKTXzOHwDYMRGKN8BO15+B
         PLL0i6kJe6GS/MZyU8aFy5M8pNSKnSwFnqdb5G9VjZEbZyY1Kul1bZftK0N2aZFns9f4
         C6ljdbfCy3riZR85vz4yoHLzata3dvbFnwM6Q906Ffu+sTAr0lIubk5V3zmEVTKccYN3
         0MpQ==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:content-transfer-encoding
         :content-language:in-reply-to:mime-version:user-agent:date
         :message-id:from:references:to:subject:arc-authentication-results
         :arc-message-signature:dkim-signature:arc-authentication-results;
        bh=NUj69IZBM5nHPsS/RvKDF8QnlWFZm7bsvQ/4CQTzqCA=;
        b=gmWJ/lVQ0eG0rh07s9U707EUgEE1nodK1JsHRDgUk6gvHJ8QCuVM5y14GjTQz4HLHT
         DDWNZOUX1zCaX+7Dhw7uNsF/03azQTXab9SJD81LSGdwsWpR8LN7TCrgR0GfAsJWt7Ei
         BJl9Sz4s/o7a+zX3HALwNXDQ8XV2MmbQUN/rY6y0Nv4keesOFTkVt8bxhZ9FjrDRnnnp
         vj2vzzNYIVYG+xg6DZ1DDkKLS+QpShievFuEr2NmVNlBgUWaHLCijy1OEvARC/Wba6Re
         Viq6QipnYDsryIbXyoOmHpCTRdgRSi/PwDA+IPKJ3T+0qaHrrrwupIfnHPv2+b 
ARC-Authentication-Results: i=2; mx.google.com;
       spf=pass (google.com: domain of david@westcontrol.com designates 213.162.250.26 as permitted sender) smtp.mailfrom=david@westcontrol.com
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=subject:to:references:from:message-id:date:user-agent:mime-version
         :in-reply-to:content-language:content-transfer-encoding
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=NUj69IZBM5nHPsS/RvKDF8QnlWFZm7bsvQ/4CQTzqCA=;
        b=fi7TnH1HlVb9hJEMrzh8eWYACcmjLB0F6huY/tIGmDXPYesxHoSfjpodahE7GeO0YY
         HCMM/IjpN7l8ubj+ZCvJKXHxXrFsilp6WTgXCT0TjZdkpANTOFG2iHA3NCBvZFIj4skT
         DxOzX5dK9xdCcvRdUSPS0y9yiKyvYmRhXdi3xksLmOozo1kVvKIqmDV/KsnnW3uMN6Cu
         KwsrQSouyAsfgah11+M1csekU13fzgSbS+5QA04+NUQcSGCt7Th//J3v2ftkQeDrDi4V
         iVptNNRovmxmGcmz5HzEdcmeoAwHFI1tiPLfjSkIHDmk5QKT/ogvI5rL84wAZO/WqniY
         Ur+ 
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:subject:to:references:from:message-id:date
         :user-agent:mime-version:in-reply-to:content-language
         :content-transfer-encoding:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=NUj69IZBM5nHPsS/RvKDF8QnlWFZm7bsvQ/4CQTzqCA=;
        b=pdES+/5DYwso/nrsWFqGtRfFj72cHX0N2LLqIEe0A0xGZryU7OBqE76482mR1CGoL6
         wbanBLHvNTj25qDPScC8ym6eVaV8Vh7deJzzeIpK9T89bKtRs7HSq1hG31c0PsiJfVvC
         eYWjt6HW9johnnyPuI4d29cZqXp3wRqjaW7n4PJJJfVMqi9wlDeXKGiFs0n1WMNomAIc
         ETinaDd71fymP+2SbpbVHpLRkKl/xyMkaFkqudTSWmuol4HGNL2u/sq2qtAvZm3BtJay
         uYe0D9tZA+yY6gpMcm5WNsReebQ8g4mdAKB90xYh3CU 
X-Gm-Message-State: AMCzsaUtTeEs8iKyP9zbmzkBFEmrVUIcDAvc9C/vbkSya2s1NyqYZUid
	C3KBGAREGllRkoYOiBDNR0friw==
X-Google-Smtp-Source: AOwi7QAOy9KaBCh0TV/jTnHU1FfdC4jSik1UOORVnrMD/zXibMB6L2U23VE3Mw6L5ZKnjS0LToA13g==
X-Received: by 10.25.35.87 with SMTP id j84mr166923lfj.23.1507459508343;
        Sun, 08 Oct 2017 03:45:08 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 10.46.48.26 with SMTP id w26ls330098ljw.6.gmail; Sun, 08 Oct 2017
 03:45:06 -0700 (PDT)
X-Received: by 10.46.75.2 with SMTP id y2mr3111650lja.91.1507459506455;
        Sun, 08 Oct 2017 03:45:06 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1507459506; cv=none;
        d=google.com; s=arc-20160816;
        b=c6Mj6WHqWr3hSe7Q/RQfXE4G/HMbz9hdSMuhHpBk6guidADqyOWSyw6jFuWtBLUtxt
         ph+3oqXB2OJwersY64pBgb2U6mpb2IKaompSd7sIO2hfw3knYEJQ31WnvvUXFfetug4r
         UEh23KRYtGjNUXxuM5Ui8haBimVt9GG1wfU5bs9hIWIsBETg9knYrvbhJqMS6rB4B1KZ
         OAb1TPEBRxZEKln3wRHDsz1prcqEBmeQd//29O4N97hVHD6rDkTIBjHjbaOjAgPclQCv
         BsCXPrqWV+DpF4m/AXONse98urJYxwldB6MK7XJZvUcqMKmqakPs5IjhBTPQRvjsaux8
         SLYg==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:content-language:in-reply-to:mime-version
         :user-agent:date:message-id:from:references:to:subject
         :arc-authentication-results;
        bh=0ZV3c+Tjq5+nSslP+zHc44U/x7QXig2SF8ycIb4VRsE=;
        b=XeqaYD7fU9h/GpQMtJOl0fBSzWB9CGeZCxuIK/UzKvEyVntA3zxs7qe7TD1jsvQpHi
         cQcaEa1wcVRkGmWThwCsqg5KobjCPoyFHq2bSFebMBxy3IwRWfB1Jio1+Hnst/4cgCMv
         CU8TuzlDt4fUDB0IoBD27kRAtdrUnKV3CrVUJdNPD1YN29evug6T5w1qH9+zEU8Z1r9d
         v5H7sRrXw5W1leDJCg31XlViuky09mIdyM6me3c9XSX1gdqIuiE+DqsB0X9PcQxD4iuZ
         CZgOI/3Kn/PGGNhmBtef4OoaiqO6nh4LOt4PvIrOP+Lzs/oSuVJ6nZM7Q9LKPoFrWXrw
         qp/Q==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=pass (google.com: domain of david@westcontrol.com designates 213.162.250.26 as permitted sender) smtp.mailfrom=david@westcontrol.com
Original-Received: from mailfilter04.hatteland.com (mailfilter04.hatteland.com. [213.162.250.26])
        by mx.google.com with ESMTPS id s139si2496557lfs.649.2017.10.08.03.45.06
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sun, 08 Oct 2017 03:45:06 -0700 (PDT)
Received-SPF: pass (google.com: domain of david@westcontrol.com designates 213.162.250.26 as permitted sender) client-ip=213.162.250.26;
Original-Received: from localhost (localhost [127.0.0.1])
	by mailfilter04.hatteland.com (Postfix) with ESMTP id 91BB7109501;
	Sun,  8 Oct 2017 12:45:14 +0200 (CEST)
X-Virus-Scanned: by SpamTitan at hatteland.com
Original-Received: from mailfilter04.hatteland.com (localhost [127.0.0.1])
	by mailfilter04.hatteland.com (Postfix) with ESMTP id CAA66109383;
	Sun,  8 Oct 2017 12:45:13 +0200 (CEST)
Original-Received: from JHSVMHUB01.netsentral.no (unknown [172.21.1.101])
	(using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits))
	(No client certificate requested)
	by mailfilter04.hatteland.com (Postfix) with ESMTPS id C506510928A;
	Sun,  8 Oct 2017 12:45:13 +0200 (CEST)
Original-Received: from [192.168.4.245] (172.21.20.100) by e2010.hatteland.com
 (172.21.1.25) with Microsoft SMTP Server (TLS) id 14.3.224.2; Sun, 8 Oct 2017
 12:45:05 +0200
In-Reply-To: <79697376-5ccd-470a-b197-ab717ae1d64a@isocpp.org>
Content-Language: en-GB
X-Originating-IP: [172.21.20.100]
X-Original-Sender: david@westcontrol.com
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of david@westcontrol.com designates 213.162.250.26 as permitted
 sender) smtp.mailfrom=david@westcontrol.com
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:34698
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/34698>



On 08/10/17 01:01, Niall Douglas wrote:
> On Saturday, October 7, 2017 at 1:24:46 AM UTC+1, David Brown wrote:
>=20
>=20
>     On 06/10/17 17:48, Niall Douglas wrote:
>      >
>      > =C2=A0 =C2=A0 Is there any reason why this could not be supported =
in the C++
>      > =C2=A0 =C2=A0 standards?
>      >
>      > Breaks compatibility with C I would imagine.
>      >
>=20
>     That would be a reasonable (but not great) justification - though I
>     don't see how it would. =C2=A0Perhaps errno support would be the prob=
lem?
>=20
>=20
> It's not even that.
>=20
> A very common use case for C++ is to compile straight-C programs for the=
=20
> improved optimisation.
>=20
> Thus a C program must run exactly the same in C++ as it would in C.=20
> Making the cmath functions go constexpr in C++ breaks that, badly.
>=20

/What/ would break?  In all the code I have written, there is nothing=20
about "sin" or other <math.h> functions that cannot be pre-calculated.=20
"sin(x)" gives the same result for compile-time constant x whether it is=20
done at run time or at compile time.  You sound so convinced that it=20
would "break badly" to do this calculation at run time (though compilers=20
certainly /do/ handle this at compile time - gcc has no problem with=20
using sin() in constexpr functions and initialisation).  What am I missing?

--=20
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp=
..org/d/msgid/std-proposals/d170ed43-361a-c5df-ff46-157240760a97%40westcontr=
ol.com.

.
