Topic: Add the modulus operator to floating point types.
Author: ryan.ang@digipen.edu
Date: Tue, 24 Apr 2018 00:07:12 -0700 (PDT)
Raw View
------=_Part_27981_451223760.1524553632169
Content-Type: multipart/alternative;
boundary="----=_Part_27982_1188685335.1524553632169"
------=_Part_27982_1188685335.1524553632169
Content-Type: text/plain; charset="UTF-8"
I think that it is discriminatory that integers have modulus operators but
floats do not.
It is unacceptable, and that is my opinion.
I propose we add the modulus operator to floating point types.
--
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 email 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/87b7dbad-2d98-4e1a-899e-4e5342691465%40isocpp.org.
------=_Part_27982_1188685335.1524553632169
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">I<span style=3D"color: rgb(29, 33, 41); font-family: Helve=
tica, Arial, sans-serif; font-size: 14px;">=C2=A0think that it is discrimin=
atory that integers have modulus operators but floats do not.</span><div><s=
pan style=3D"color: rgb(29, 33, 41); font-family: Helvetica, Arial, sans-se=
rif; font-size: 14px;">It is unacceptable, and that is my opinion.</span></=
div><div><span style=3D"color: rgb(29, 33, 41); font-family: Helvetica, Ari=
al, sans-serif; font-size: 14px;"><br></span></div><div><span style=3D"colo=
r: rgb(29, 33, 41); font-family: Helvetica, Arial, sans-serif; font-size: 1=
4px;">I propose we add the modulus operator to floating point types.</span>=
</div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465=
%40isocpp.org</a>.<br />
------=_Part_27982_1188685335.1524553632169--
------=_Part_27981_451223760.1524553632169--
.
Author: Jeff Hammond <jeff.science@gmail.com>
Date: Tue, 24 Apr 2018 10:31:06 +0300
Raw View
--001a1145b2d861b2fb056a932400
Content-Type: text/plain; charset="UTF-8"
http://en.cppreference.com/w/cpp/numeric/math/fmod?
On Tue, Apr 24, 2018 at 10:07 AM, <ryan.ang@digipen.edu> wrote:
> I think that it is discriminatory that integers have modulus operators
> but floats do not.
> It is unacceptable, and that is my opinion.
>
> I propose we add the modulus operator to floating point types.
>
> --
> 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
> email 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/87b7dbad-2d98-4e1a-
> 899e-4e5342691465%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
Jeff Hammond
jeff.science@gmail.com
http://jeffhammond.github.io/
--
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 email 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/CAGKz%3DuJg%2BuTuk%3D1wpmuvBG8F6MNW-Rv%3DdDW%2Bu%3DopR8SvbvkcJQ%40mail.gmail.com.
--001a1145b2d861b2fb056a932400
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><a href=3D"http://en.cppreference.com/w/cpp/numeric/math/f=
mod">http://en.cppreference.com/w/cpp/numeric/math/fmod</a>?<br></div><div =
class=3D"gmail_extra"><br><div class=3D"gmail_quote">On Tue, Apr 24, 2018 a=
t 10:07 AM, <span dir=3D"ltr"><<a href=3D"mailto:ryan.ang@digipen.edu" =
target=3D"_blank">ryan.ang@digipen.edu</a>></span> wrote:<br><blockquote=
class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc soli=
d;padding-left:1ex"><div dir=3D"ltr">I<span style=3D"color:rgb(29,33,41);fo=
nt-family:Helvetica,Arial,sans-serif;font-size:14px">=C2=A0think that it is=
discriminatory that integers have modulus operators but floats do not.</sp=
an><div><span style=3D"color:rgb(29,33,41);font-family:Helvetica,Arial,sans=
-serif;font-size:14px">It is unacceptable, and that is my opinion.</span></=
div><div><span style=3D"color:rgb(29,33,41);font-family:Helvetica,Arial,san=
s-serif;font-size:14px"><br></span></div><div><span style=3D"color:rgb(29,3=
3,41);font-family:Helvetica,Arial,sans-serif;font-size:14px">I propose we a=
dd the modulus operator to floating point types.</span></div></div><span cl=
ass=3D"HOEnZb"><font color=3D"#888888">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/87b7=
dbad-2d98-4e1a-<wbr>899e-4e5342691465%40isocpp.org</a><wbr>.<br>
</font></span></blockquote></div><br><br clear=3D"all"><div><br></div>-- <b=
r><div class=3D"gmail_signature" data-smartmail=3D"gmail_signature">Jeff Ha=
mmond<br><a href=3D"mailto:jeff.science@gmail.com" target=3D"_blank">jeff.s=
cience@gmail.com</a><br><a href=3D"http://jeffhammond.github.io/" target=3D=
"_blank">http://jeffhammond.github.io/</a></div>
</div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAGKz%3DuJg%2BuTuk%3D1wpmuvBG8F6MNW-R=
v%3DdDW%2Bu%3DopR8SvbvkcJQ%40mail.gmail.com?utm_medium=3Demail&utm_source=
=3Dfooter">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAG=
Kz%3DuJg%2BuTuk%3D1wpmuvBG8F6MNW-Rv%3DdDW%2Bu%3DopR8SvbvkcJQ%40mail.gmail.c=
om</a>.<br />
--001a1145b2d861b2fb056a932400--
.
Author: ryan.ang@digipen.edu
Date: Tue, 24 Apr 2018 00:47:12 -0700 (PDT)
Raw View
------=_Part_25098_2041155096.1524556033039
Content-Type: multipart/alternative;
boundary="----=_Part_25099_601450675.1524556033040"
------=_Part_25099_601450675.1524556033040
Content-Type: text/plain; charset="UTF-8"
constexpr float f = 13.f % 2.1f; // f == 0.4
constexpr float f = std::fmod(13.f, 2.1f); // not compilable
On Tuesday, April 24, 2018 at 3:31:29 PM UTC+8, Jeff Hammond wrote:
>
> http://en.cppreference.com/w/cpp/numeric/math/fmod?
>
> On Tue, Apr 24, 2018 at 10:07 AM, <ryan...@digipen.edu <javascript:>>
> wrote:
>
>> I think that it is discriminatory that integers have modulus operators
>> but floats do not.
>> It is unacceptable, and that is my opinion.
>>
>> I propose we add the modulus operator to floating point types.
>>
>> --
>> 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
>> email to std-proposal...@isocpp.org <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%40isocpp.org
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%40isocpp.org?utm_medium=email&utm_source=footer>
>> .
>>
>
>
>
> --
> Jeff Hammond
> jeff.s...@gmail.com <javascript:>
> http://jeffhammond.github.io/
>
--
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 email 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/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%40isocpp.org.
------=_Part_25099_601450675.1524556033040
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"prettyprint" style=3D"background-color: rgb(=
250, 250, 250); border-color: rgb(187, 187, 187); border-style: solid; bord=
er-width: 1px; word-wrap: break-word;"><code class=3D"prettyprint"><div cla=
ss=3D"subprettyprint"><span style=3D"color: #008;" class=3D"styled-by-prett=
ify">constexpr</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: #008;" class=3D"styled-by-prettify">float=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> f </span>=
<span style=3D"color: #660;" class=3D"styled-by-prettify">=3D</span><span s=
tyle=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=3D"c=
olor: #066;" class=3D"styled-by-prettify">13.f</span><span style=3D"color: =
#000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #660;" cl=
ass=3D"styled-by-prettify">%</span><span style=3D"color: #000;" class=3D"st=
yled-by-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by-p=
rettify">2.1f</span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">;</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </spa=
n><span style=3D"color: #800;" class=3D"styled-by-prettify">// f =3D=3D 0.4=
</span><span style=3D"color: #000;" class=3D"styled-by-prettify"><br></span=
><span style=3D"color: #008;" class=3D"styled-by-prettify">constexpr</span>=
<span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span sty=
le=3D"color: #008;" class=3D"styled-by-prettify">float</span><span style=3D=
"color: #000;" class=3D"styled-by-prettify"> f </span><span style=3D"color:=
#660;" class=3D"styled-by-prettify">=3D</span><span style=3D"color: #000;"=
class=3D"styled-by-prettify"> std</span><span style=3D"color: #660;" class=
=3D"styled-by-prettify">::</span><span style=3D"color: #000;" class=3D"styl=
ed-by-prettify">fmod</span><span style=3D"color: #660;" class=3D"styled-by-=
prettify">(</span><span style=3D"color: #066;" class=3D"styled-by-prettify"=
>13.f</span><span style=3D"color: #660;" class=3D"styled-by-prettify">,</sp=
an><span style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span =
style=3D"color: #066;" class=3D"styled-by-prettify">2.1f</span><span style=
=3D"color: #660;" class=3D"styled-by-prettify">);</span><span style=3D"colo=
r: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #800;"=
class=3D"styled-by-prettify">// not compilable</span><span style=3D"color:=
#000;" class=3D"styled-by-prettify"><br></span></div></code></div><div><br=
><br>On Tuesday, April 24, 2018 at 3:31:29 PM UTC+8, Jeff Hammond wrote:<bl=
ockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0.8ex;border=
-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><a href=3D"http:=
//en.cppreference.com/w/cpp/numeric/math/fmod" target=3D"_blank" rel=3D"nof=
ollow" onmousedown=3D"this.href=3D'http://www.google.com/url?q\x3dhttp%=
3A%2F%2Fen.cppreference.com%2Fw%2Fcpp%2Fnumeric%2Fmath%2Ffmod\x26sa\x3dD\x2=
6sntz\x3d1\x26usg\x3dAFQjCNFeKjMKYlI0hRXiXxDaNT2ryT1fjg';return true;" =
onclick=3D"this.href=3D'http://www.google.com/url?q\x3dhttp%3A%2F%2Fen.=
cppreference.com%2Fw%2Fcpp%2Fnumeric%2Fmath%2Ffmod\x26sa\x3dD\x26sntz\x3d1\=
x26usg\x3dAFQjCNFeKjMKYlI0hRXiXxDaNT2ryT1fjg';return true;">http://en.c=
ppreference.com/w/<wbr>cpp/numeric/math/fmod</a>?<br></div><div><br><div cl=
ass=3D"gmail_quote">On Tue, Apr 24, 2018 at 10:07 AM, <span dir=3D"ltr">&l=
t;<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"XZkXFH=
fhAwAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D'javascript:';r=
eturn true;" onclick=3D"this.href=3D'javascript:';return true;">rya=
n...@digipen.edu</a>></span> wrote:<br><blockquote class=3D"gmail_quote"=
style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><d=
iv dir=3D"ltr">I<span style=3D"color:rgb(29,33,41);font-family:Helvetica,Ar=
ial,sans-serif;font-size:14px">=C2=A0think that it is discriminatory that i=
ntegers have modulus operators but floats do not.</span><div><span style=3D=
"color:rgb(29,33,41);font-family:Helvetica,Arial,sans-serif;font-size:14px"=
>It is unacceptable, and that is my opinion.</span></div><div><span style=
=3D"color:rgb(29,33,41);font-family:Helvetica,Arial,sans-serif;font-size:14=
px"><br></span></div><div><span style=3D"color:rgb(29,33,41);font-family:He=
lvetica,Arial,sans-serif;font-size:14px">I propose we add the modulus opera=
tor to floating point types.</span></div></div><span><font color=3D"#888888=
">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
XZkXFHfhAwAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D'javascript:&=
#39;;return true;" onclick=3D"this.href=3D'javascript:';return true=
;">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"XZkXFHfhAwAJ" rel=3D"nofollow" onmousedown=3D"=
this.href=3D'javascript:';return true;" onclick=3D"this.href=3D'=
;javascript:';return true;">std-pr...@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank" =
rel=3D"nofollow" onmousedown=3D"this.href=3D'https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter';return true;" on=
click=3D"this.href=3D'https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter';return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/87b7dbad-2d98-4e1a-<wbr>899e-=
4e5342691465%40isocpp.org</a><wbr>.<br>
</font></span></blockquote></div><br><br clear=3D"all"><div><br></div>-- <b=
r><div>Jeff Hammond<br><a href=3D"javascript:" target=3D"_blank" gdf-obfusc=
ated-mailto=3D"XZkXFHfhAwAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D&#=
39;javascript:';return true;" onclick=3D"this.href=3D'javascript:&#=
39;;return true;">jeff.s...@gmail.com</a><br><a href=3D"http://jeffhammond.=
github.io/" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D&=
#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fjeffhammond.github.io%2F\x2=
6sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFjRmVnG_zjh9sinCbjcFRCVwxZrQ';ret=
urn true;" onclick=3D"this.href=3D'http://www.google.com/url?q\x3dhttp%=
3A%2F%2Fjeffhammond.github.io%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFj=
RmVnG_zjh9sinCbjcFRCVwxZrQ';return true;">http://jeffhammond.github.io/=
</a></div>
</div>
</blockquote></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77=
%40isocpp.org</a>.<br />
------=_Part_25099_601450675.1524556033040--
------=_Part_25098_2041155096.1524556033039--
.
Author: John McFarlane <john@mcfarlane.name>
Date: Tue, 24 Apr 2018 09:43:31 +0000
Raw View
--94eb2c07a5f268abb0056a94fd71
Content-Type: text/plain; charset="UTF-8"
The remainder can be thought of as the value that is lost as a result of
rounding down of the quotient. The rounding occurs because integers have a
fixed resolution of 1. Floats do not.
For integer division, if n/d=q and n%d=r then if follows that q*d+r=n. So
having a remainder of 0.4f in your example only makes sense if 13.f / 2.1f
== 6 and that would change the behavior of floating-point division.
On Tue, Apr 24, 2018 at 12:47 AM <ryan.ang@digipen.edu> wrote:
> constexpr float f = 13.f % 2.1f; // f == 0.4
> constexpr float f = std::fmod(13.f, 2.1f); // not compilable
>
>
> On Tuesday, April 24, 2018 at 3:31:29 PM UTC+8, Jeff Hammond wrote:
>
>> http://en.cppreference.com/w/cpp/numeric/math/fmod?
>>
>> On Tue, Apr 24, 2018 at 10:07 AM, <ryan...@digipen.edu> wrote:
>>
> I think that it is discriminatory that integers have modulus operators
>>> but floats do not.
>>> It is unacceptable, and that is my opinion.
>>>
>>> I propose we add the modulus operator to floating point types.
>>>
>> --
>>> 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
>>> email to std-proposal...@isocpp.org.
>>> To post to this group, send email to std-pr...@isocpp.org.
>>
>>
>>> To view this discussion on the web visit
>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%40isocpp.org
>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%40isocpp.org?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>>
>> --
>> Jeff Hammond
>> jeff.s...@gmail.com
>> http://jeffhammond.github.io/
>>
> --
> 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
> email 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/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
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 email 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/CABPJVnQJce-hVshvqE-Hm2SRgibtKoMKaNxATQ-L8eN41n2qVQ%40mail.gmail.com.
--94eb2c07a5f268abb0056a94fd71
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>The remainder can be thought of as the value that is =
lost as a result of rounding down of the quotient.=20
The rounding occurs because integers have a fixed resolution of 1. Floats d=
o not.<br></div><div><br></div><div>For integer division, if n/d=3Dq
and n%d=3Dr then if follows that q*d+r=3Dn.=20
So having a remainder of 0.4f in your example only makes sense if 13.f / 2.=
1f =3D=3D 6 and that would change the behavior of floating-point division.<=
br><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Tue, Apr 24, 2018 at =
12:47 AM <<a href=3D"mailto:ryan.ang@digipen.edu">ryan.ang@digipen.edu</=
a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 =
0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div=
class=3D"m_-2727154858611649672prettyprint" style=3D"background-color:rgb(=
250,250,250);border-color:rgb(187,187,187);border-style:solid;border-width:=
1px;word-wrap:break-word"><code class=3D"m_-2727154858611649672prettyprint"=
><div class=3D"m_-2727154858611649672subprettyprint"><span style=3D"color:#=
008" class=3D"m_-2727154858611649672styled-by-prettify">constexpr</span><sp=
an style=3D"color:#000" class=3D"m_-2727154858611649672styled-by-prettify">=
</span><span style=3D"color:#008" class=3D"m_-2727154858611649672styled-by=
-prettify">float</span><span style=3D"color:#000" class=3D"m_-2727154858611=
649672styled-by-prettify"> f </span><span style=3D"color:#660" class=3D"m_-=
2727154858611649672styled-by-prettify">=3D</span><span style=3D"color:#000"=
class=3D"m_-2727154858611649672styled-by-prettify"> </span><span style=3D"=
color:#066" class=3D"m_-2727154858611649672styled-by-prettify">13.f</span><=
span style=3D"color:#000" class=3D"m_-2727154858611649672styled-by-prettify=
"> </span><span style=3D"color:#660" class=3D"m_-2727154858611649672styled-=
by-prettify">%</span><span style=3D"color:#000" class=3D"m_-272715485861164=
9672styled-by-prettify"> </span><span style=3D"color:#066" class=3D"m_-2727=
154858611649672styled-by-prettify">2.1f</span><span style=3D"color:#660" cl=
ass=3D"m_-2727154858611649672styled-by-prettify">;</span><span style=3D"col=
or:#000" class=3D"m_-2727154858611649672styled-by-prettify"> </span><span s=
tyle=3D"color:#800" class=3D"m_-2727154858611649672styled-by-prettify">// f=
=3D=3D 0.4</span><span style=3D"color:#000" class=3D"m_-272715485861164967=
2styled-by-prettify"><br></span><span style=3D"color:#008" class=3D"m_-2727=
154858611649672styled-by-prettify">constexpr</span><span style=3D"color:#00=
0" class=3D"m_-2727154858611649672styled-by-prettify"> </span><span style=
=3D"color:#008" class=3D"m_-2727154858611649672styled-by-prettify">float</s=
pan><span style=3D"color:#000" class=3D"m_-2727154858611649672styled-by-pre=
ttify"> f </span><span style=3D"color:#660" class=3D"m_-2727154858611649672=
styled-by-prettify">=3D</span><span style=3D"color:#000" class=3D"m_-272715=
4858611649672styled-by-prettify"> std</span><span style=3D"color:#660" clas=
s=3D"m_-2727154858611649672styled-by-prettify">::</span><span style=3D"colo=
r:#000" class=3D"m_-2727154858611649672styled-by-prettify">fmod</span><span=
style=3D"color:#660" class=3D"m_-2727154858611649672styled-by-prettify">(<=
/span><span style=3D"color:#066" class=3D"m_-2727154858611649672styled-by-p=
rettify">13.f</span><span style=3D"color:#660" class=3D"m_-2727154858611649=
672styled-by-prettify">,</span><span style=3D"color:#000" class=3D"m_-27271=
54858611649672styled-by-prettify"> </span><span style=3D"color:#066" class=
=3D"m_-2727154858611649672styled-by-prettify">2.1f</span><span style=3D"col=
or:#660" class=3D"m_-2727154858611649672styled-by-prettify">);</span><span =
style=3D"color:#000" class=3D"m_-2727154858611649672styled-by-prettify"> </=
span><span style=3D"color:#800" class=3D"m_-2727154858611649672styled-by-pr=
ettify">// not compilable</span><span style=3D"color:#000" class=3D"m_-2727=
154858611649672styled-by-prettify"><br></span></div></code></div></div><div=
dir=3D"ltr"><div><br><br>On Tuesday, April 24, 2018 at 3:31:29 PM UTC+8, J=
eff Hammond wrote:</div></div><div dir=3D"ltr"><div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;p=
adding-left:1ex"><div dir=3D"ltr"><a href=3D"http://en.cppreference.com/w/c=
pp/numeric/math/fmod" rel=3D"nofollow" target=3D"_blank">http://en.cpprefer=
ence.com/w/cpp/numeric/math/fmod</a>?<br></div><div><br></div></blockquote>=
</div></div><div dir=3D"ltr"><div><blockquote class=3D"gmail_quote" style=
=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"=
><div><div class=3D"gmail_quote">On Tue, Apr 24, 2018 at 10:07 AM, <span d=
ir=3D"ltr"><<a rel=3D"nofollow">ryan...@digipen.edu</a>></span> wrote=
:<br></div></div></blockquote></div></div><div dir=3D"ltr"><div><blockquote=
class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px =
#ccc solid;padding-left:1ex"><div><div class=3D"gmail_quote"><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;p=
adding-left:1ex"><div dir=3D"ltr">I<span style=3D"color:rgb(29,33,41);font-=
family:Helvetica,Arial,sans-serif;font-size:14px">=C2=A0think that it is di=
scriminatory that integers have modulus operators but floats do not.</span>=
<div><span style=3D"color:rgb(29,33,41);font-family:Helvetica,Arial,sans-se=
rif;font-size:14px">It is unacceptable, and that is my opinion.</span></div=
><div><span style=3D"color:rgb(29,33,41);font-family:Helvetica,Arial,sans-s=
erif;font-size:14px"><br></span></div><div><span style=3D"color:rgb(29,33,4=
1);font-family:Helvetica,Arial,sans-serif;font-size:14px">I propose we add =
the modulus operator to floating point types.</span></div></div></blockquot=
e></div></div></blockquote></div></div><div dir=3D"ltr"><div><blockquote cl=
ass=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:1px #cc=
c solid;padding-left:1ex"><div><div class=3D"gmail_quote"><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><span><font color=3D"#888888">
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br></font></span></bl=
ockquote></div></div></blockquote></div></div><div dir=3D"ltr"><div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:=
1px #ccc solid;padding-left:1ex"><div><div class=3D"gmail_quote"><blockquot=
e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
id;padding-left:1ex"><span><font color=3D"#888888">
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a rel=3D"nofollow">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@isocpp.o=
rg</a>.</font></span></blockquote></div></div></blockquote></div></div><div=
dir=3D"ltr"><div><blockquote class=3D"gmail_quote" style=3D"margin:0;margi=
n-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class=
=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8=
ex;border-left:1px #ccc solid;padding-left:1ex"><span><font color=3D"#88888=
8"><br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" rel=3D"nofollow" t=
arget=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/std-proposa=
ls/87b7dbad-2d98-4e1a-899e-4e5342691465%40isocpp.org</a>.<br>
</font></span></blockquote></div></div></blockquote></div></div><div dir=3D=
"ltr"><div><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:=
0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class=3D"gmail=
_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border=
-left:1px #ccc solid;padding-left:1ex"><span></span></blockquote></div><br>=
<br clear=3D"all"><div><br></div>-- <br><div>Jeff Hammond<br><a rel=3D"nofo=
llow">jeff.s...@gmail.com</a><br><a href=3D"http://jeffhammond.github.io/" =
rel=3D"nofollow" target=3D"_blank">http://jeffhammond.github.io/</a></div>
</div>
</blockquote></div></div>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/90618fc9-0eb2-=
42bd-ad8e-3c983a3fde77%40isocpp.org</a>.<br>
</blockquote></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CABPJVnQJce-hVshvqE-Hm2SRgibtKoMKaNxA=
TQ-L8eN41n2qVQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CABPJVnQJce-hVshv=
qE-Hm2SRgibtKoMKaNxATQ-L8eN41n2qVQ%40mail.gmail.com</a>.<br />
--94eb2c07a5f268abb0056a94fd71--
.
Author: ryan.ang@digipen.edu
Date: Tue, 24 Apr 2018 03:25:53 -0700 (PDT)
Raw View
------=_Part_28922_86295522.1524565553524
Content-Type: multipart/alternative;
boundary="----=_Part_28923_716172475.1524565553524"
------=_Part_28923_716172475.1524565553524
Content-Type: text/plain; charset="UTF-8"
*You*: "The remainder can be thought of as the value that is lost as a
result of rounding down of the quotient"
*Wikipedia*: "In computing, the modulo operation finds the remainder after
division of one number by another" - Modulo operation, Wikipedia
<https://en.wikipedia.org/wiki/Modulo_operation>
*Wikipedia *does not exclude the use of modulo on floating point types.
*You **happen *to be true if the operands are *integral*.
What do you think?
On Tuesday, April 24, 2018 at 5:43:44 PM UTC+8, John McFarlane wrote:
>
> The remainder can be thought of as the value that is lost as a result of
> rounding down of the quotient. The rounding occurs because integers have a
> fixed resolution of 1. Floats do not.
>
> For integer division, if n/d=q and n%d=r then if follows that q*d+r=n. So
> having a remainder of 0.4f in your example only makes sense if 13.f / 2.1f
> == 6 and that would change the behavior of floating-point division.
>
> On Tue, Apr 24, 2018 at 12:47 AM <ryan...@digipen.edu <javascript:>>
> wrote:
>
>> constexpr float f = 13.f % 2.1f; // f == 0.4
>> constexpr float f = std::fmod(13.f, 2.1f); // not compilable
>>
>>
>> On Tuesday, April 24, 2018 at 3:31:29 PM UTC+8, Jeff Hammond wrote:
>>
>>> http://en.cppreference.com/w/cpp/numeric/math/fmod?
>>>
>>> On Tue, Apr 24, 2018 at 10:07 AM, <ryan...@digipen.edu> wrote:
>>>
>> I think that it is discriminatory that integers have modulus operators
>>>> but floats do not.
>>>> It is unacceptable, and that is my opinion.
>>>>
>>>> I propose we add the modulus operator to floating point types.
>>>>
>>> --
>>>> 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 email to std-proposal...@isocpp.org.
>>>> To post to this group, send email to std-pr...@isocpp.org.
>>>
>>>
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%40isocpp.org
>>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%40isocpp.org?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>
>>>
>>>
>>> --
>>> Jeff Hammond
>>> jeff.s...@gmail.com
>>> http://jeffhammond.github.io/
>>>
>> --
>> 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
>> email to std-proposal...@isocpp.org <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%40isocpp.org
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%40isocpp.org?utm_medium=email&utm_source=footer>
>> .
>>
>
--
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 email 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/fb80b787-f3be-4392-a37e-e38ab878b489%40isocpp.org.
------=_Part_28923_716172475.1524565553524
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><b>You</b>: "The remainder can be thought of as =
the value that is lost as a result of rounding down of the quotient"</=
div><div><b>Wikipedia</b>: "In computing, the modulo operation finds t=
he remainder after division of one number by another" - <a href=3D"htt=
ps://en.wikipedia.org/wiki/Modulo_operation">Modulo operation, Wikipedia</a=
></div><div><br></div><b>Wikipedia=C2=A0</b>does not exclude the=C2=A0use o=
f modulo on floating point types.<div><div><b>You=C2=A0</b><i>happen=C2=A0<=
/i>to be true if the operands are <i>integral</i>.</div><div>What do you th=
ink?</div><div><br></div><br>On Tuesday, April 24, 2018 at 5:43:44 PM UTC+8=
, John McFarlane wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0=
;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div di=
r=3D"ltr"><div>The remainder can be thought of as the value that is lost as=
a result of rounding down of the quotient.=20
The rounding occurs because integers have a fixed resolution of 1. Floats d=
o not.<br></div><div><br></div><div>For integer division, if n/d=3Dq
and n%d=3Dr then if follows that q*d+r=3Dn.=20
So having a remainder of 0.4f in your example only makes sense if 13.f / 2.=
1f =3D=3D 6 and that would change the behavior of floating-point division.<=
br><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Tue, Apr 24, 2018 at =
12:47 AM <<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailt=
o=3D"_cx0n67oAwAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D'javascr=
ipt:';return true;" onclick=3D"this.href=3D'javascript:';return=
true;">ryan...@digipen.edu</a>> wrote:<br></div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-le=
ft:1ex"><div dir=3D"ltr"><div style=3D"background-color:rgb(250,250,250);bo=
rder-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:b=
reak-word"><code><div><span style=3D"color:#008">constexpr</span><span styl=
e=3D"color:#000"> </span><span style=3D"color:#008">float</span><span style=
=3D"color:#000"> f </span><span style=3D"color:#660">=3D</span><span style=
=3D"color:#000"> </span><span style=3D"color:#066">13.f</span><span style=
=3D"color:#000"> </span><span style=3D"color:#660">%</span><span style=3D"c=
olor:#000"> </span><span style=3D"color:#066">2.1f</span><span style=3D"col=
or:#660">;</span><span style=3D"color:#000"> </span><span style=3D"color:#8=
00">// f =3D=3D 0.4</span><span style=3D"color:#000"><br></span><span style=
=3D"color:#008">constexpr</span><span style=3D"color:#000"> </span><span st=
yle=3D"color:#008">float</span><span style=3D"color:#000"> f </span><span s=
tyle=3D"color:#660">=3D</span><span style=3D"color:#000"> std</span><span s=
tyle=3D"color:#660">::</span><span style=3D"color:#000">fmod</span><span st=
yle=3D"color:#660">(</span><span style=3D"color:#066">13.f</span><span styl=
e=3D"color:#660">,</span><span style=3D"color:#000"> </span><span style=3D"=
color:#066">2.1f</span><span style=3D"color:#660">);</span><span style=3D"c=
olor:#000"> </span><span style=3D"color:#800">// not compilable</span><span=
style=3D"color:#000"><br></span></div></code></div></div><div dir=3D"ltr">=
<div><br><br>On Tuesday, April 24, 2018 at 3:31:29 PM UTC+8, Jeff Hammond w=
rote:</div></div><div dir=3D"ltr"><div><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1=
ex"><div dir=3D"ltr"><a href=3D"http://en.cppreference.com/w/cpp/numeric/ma=
th/fmod" rel=3D"nofollow" target=3D"_blank" onmousedown=3D"this.href=3D'=
;http://www.google.com/url?q\x3dhttp%3A%2F%2Fen.cppreference.com%2Fw%2Fcpp%=
2Fnumeric%2Fmath%2Ffmod\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFeKjMKYlI0h=
RXiXxDaNT2ryT1fjg';return true;" onclick=3D"this.href=3D'http://www=
..google.com/url?q\x3dhttp%3A%2F%2Fen.cppreference.com%2Fw%2Fcpp%2Fnumeric%2=
Fmath%2Ffmod\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFeKjMKYlI0hRXiXxDaNT2r=
yT1fjg';return true;">http://en.cppreference.com/w/<wbr>cpp/numeric/mat=
h/fmod</a>?<br></div><div><br></div></blockquote></div></div><div dir=3D"lt=
r"><div><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8=
ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class=3D"gmail_qu=
ote">On Tue, Apr 24, 2018 at 10:07 AM, <span dir=3D"ltr"><<a rel=3D"nof=
ollow">ryan...@digipen.edu</a>></span> wrote:<br></div></div></blockquot=
e></div></div><div dir=3D"ltr"><div><blockquote class=3D"gmail_quote" style=
=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"=
><div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D=
"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D=
"ltr">I<span style=3D"color:rgb(29,33,41);font-family:Helvetica,Arial,sans-=
serif;font-size:14px">=C2=A0think that it is discriminatory that integers h=
ave modulus operators but floats do not.</span><div><span style=3D"color:rg=
b(29,33,41);font-family:Helvetica,Arial,sans-serif;font-size:14px">It is un=
acceptable, and that is my opinion.</span></div><div><span style=3D"color:r=
gb(29,33,41);font-family:Helvetica,Arial,sans-serif;font-size:14px"><br></s=
pan></div><div><span style=3D"color:rgb(29,33,41);font-family:Helvetica,Ari=
al,sans-serif;font-size:14px">I propose we add the modulus operator to floa=
ting point types.</span></div></div></blockquote></div></div></blockquote><=
/div></div><div dir=3D"ltr"><div><blockquote class=3D"gmail_quote" style=3D=
"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><d=
iv><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><font co=
lor=3D"#888888">
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br></font></span></bl=
ockquote></div></div></blockquote></div></div><div dir=3D"ltr"><div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:=
1px #ccc solid;padding-left:1ex"><div><div class=3D"gmail_quote"><blockquot=
e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
id;padding-left:1ex"><span><font color=3D"#888888">
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a rel=3D"nofollow">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@isocpp.o=
rg</a>.</font></span></blockquote></div></div></blockquote></div></div><div=
dir=3D"ltr"><div><blockquote class=3D"gmail_quote" style=3D"margin:0;margi=
n-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class=
=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8=
ex;border-left:1px #ccc solid;padding-left:1ex"><span><font color=3D"#88888=
8"><br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" rel=3D"nofollow" t=
arget=3D"_blank" onmousedown=3D"this.href=3D'https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter';return true;" on=
click=3D"this.href=3D'https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter';return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/87b7dbad-2d98-4e1a-<wbr>899e-=
4e5342691465%40isocpp.org</a><wbr>.<br>
</font></span></blockquote></div></div></blockquote></div></div><div dir=3D=
"ltr"><div><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:=
0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class=3D"gmail=
_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border=
-left:1px #ccc solid;padding-left:1ex"><span></span></blockquote></div><br>=
<br clear=3D"all"><div><br></div>-- <br><div>Jeff Hammond<br><a rel=3D"nofo=
llow">jeff.s...@gmail.com</a><br><a href=3D"http://jeffhammond.github.io/" =
rel=3D"nofollow" target=3D"_blank" onmousedown=3D"this.href=3D'http://w=
ww.google.com/url?q\x3dhttp%3A%2F%2Fjeffhammond.github.io%2F\x26sa\x3dD\x26=
sntz\x3d1\x26usg\x3dAFQjCNFjRmVnG_zjh9sinCbjcFRCVwxZrQ';return true;" o=
nclick=3D"this.href=3D'http://www.google.com/url?q\x3dhttp%3A%2F%2Fjeff=
hammond.github.io%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFjRmVnG_zjh9si=
nCbjcFRCVwxZrQ';return true;">http://jeffhammond.github.io/</a></div>
</div>
</blockquote></div></div>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
_cx0n67oAwAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D'javascript:&=
#39;;return true;" onclick=3D"this.href=3D'javascript:';return true=
;">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"_cx0n67oAwAJ" rel=3D"nofollow" onmousedown=3D"=
this.href=3D'javascript:';return true;" onclick=3D"this.href=3D'=
;javascript:';return true;">std-pr...@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank" =
rel=3D"nofollow" onmousedown=3D"this.href=3D'https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter';return true;" on=
click=3D"this.href=3D'https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter';return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/90618fc9-0eb2-42bd-<wbr>ad8e-=
3c983a3fde77%40isocpp.org</a><wbr>.<br>
</blockquote></div></div></div>
</blockquote></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/fb80b787-f3be-4392-a37e-e38ab878b489%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/fb80b787-f3be-4392-a37e-e38ab878b489=
%40isocpp.org</a>.<br />
------=_Part_28923_716172475.1524565553524--
------=_Part_28922_86295522.1524565553524--
.
Author: Tony V E <tvaneerd@gmail.com>
Date: Tue, 24 Apr 2018 06:29:29 -0400
Raw View
<html><head></head><body lang=3D"en-US" style=3D"background-color: rgb(255,=
255, 255); line-height: initial;"> =
<div style=3D"width: 100%; fo=
nt-size: initial; font-family: Calibri, 'Slate Pro', sans-serif, sans-serif=
; color: rgb(31, 73, 125); text-align: initial; background-color: rgb(255, =
255, 255);">Would you be equally happy if fmod was made constexpr? </d=
iv><div style=3D"width: 100%; font-size: initial; font-family: Calibri, 'Sl=
ate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); text-align: init=
ial; background-color: rgb(255, 255, 255);">(instead of % for floats)</div>=
=
<div style=3D"wid=
th: 100%; font-size: initial; font-family: Calibri, 'Slate Pro', sans-serif=
, sans-serif; color: rgb(31, 73, 125); text-align: initial; background-colo=
r: rgb(255, 255, 255);"><br style=3D"display:initial"></div> =
=
=
<div style=3D"font-size: initial; font-family=
: Calibri, 'Slate Pro', sans-serif, sans-serif; color: rgb(31, 73, 125); te=
xt-align: initial; background-color: rgb(255, 255, 255);">Sent from&nb=
sp;my BlackBerry portable Babbage Device</div> =
=
=
<table width=3D"100%" style=3D"background-color:white;bo=
rder-spacing:0px;"> <tbody><tr><td colspan=3D"2" style=3D"font-size: initia=
l; text-align: initial; background-color: rgb(255, 255, 255);"> =
<div style=3D"border-style: solid none none; border-top-colo=
r: rgb(181, 196, 223); border-top-width: 1pt; padding: 3pt 0in 0in; font-fa=
mily: Tahoma, 'BB Alpha Sans', 'Slate Pro'; font-size: 10pt;"> <div><b>Fro=
m: </b>ryan.ang@digipen.edu</div><div><b>Sent: </b>Tuesday, April 24, 2018 =
3:47 AM</div><div><b>To: </b>ISO C++ Standard - Future Proposals</div><div>=
<b>Reply To: </b>std-proposals@isocpp.org</div><div><b>Subject: </b>Re: [st=
d-proposals] Add the modulus operator to floating point types.</div></div><=
/td></tr></tbody></table><div style=3D"border-style: solid none none; borde=
r-top-color: rgb(186, 188, 209); border-top-width: 1pt; font-size: initial;=
text-align: initial; background-color: rgb(255, 255, 255);"></div><br><div=
id=3D"_originalContent" style=3D""><div dir=3D"ltr"><div class=3D"prettypr=
int" style=3D"background-color: rgb(250, 250, 250); border-color: rgb(187, =
187, 187); border-style: solid; border-width: 1px; word-wrap: break-word;">=
<code class=3D"prettyprint"><div class=3D"subprettyprint"><span style=3D"co=
lor: #008;" class=3D"styled-by-prettify">constexpr</span><span style=3D"col=
or: #000;" class=3D"styled-by-prettify"> </span><span style=3D"color: #008;=
" class=3D"styled-by-prettify">float</span><span style=3D"color: #000;" cla=
ss=3D"styled-by-prettify"> f </span><span style=3D"color: #660;" class=3D"s=
tyled-by-prettify">=3D</span><span style=3D"color: #000;" class=3D"styled-b=
y-prettify"> </span><span style=3D"color: #066;" class=3D"styled-by-prettif=
y">13.f</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> </=
span><span style=3D"color: #660;" class=3D"styled-by-prettify">%</span><spa=
n style=3D"color: #000;" class=3D"styled-by-prettify"> </span><span style=
=3D"color: #066;" class=3D"styled-by-prettify">2.1f</span><span style=3D"co=
lor: #660;" class=3D"styled-by-prettify">;</span><span style=3D"color: #000=
;" class=3D"styled-by-prettify"> </span><span style=3D"color: #800;" class=
=3D"styled-by-prettify">// f =3D=3D 0.4</span><span style=3D"color: #000;" =
class=3D"styled-by-prettify"><br></span><span style=3D"color: #008;" class=
=3D"styled-by-prettify">constexpr</span><span style=3D"color: #000;" class=
=3D"styled-by-prettify"> </span><span style=3D"color: #008;" class=3D"style=
d-by-prettify">float</span><span style=3D"color: #000;" class=3D"styled-by-=
prettify"> f </span><span style=3D"color: #660;" class=3D"styled-by-prettif=
y">=3D</span><span style=3D"color: #000;" class=3D"styled-by-prettify"> std=
</span><span style=3D"color: #660;" class=3D"styled-by-prettify">::</span><=
span style=3D"color: #000;" class=3D"styled-by-prettify">fmod</span><span s=
tyle=3D"color: #660;" class=3D"styled-by-prettify">(</span><span style=3D"c=
olor: #066;" class=3D"styled-by-prettify">13.f</span><span style=3D"color: =
#660;" class=3D"styled-by-prettify">,</span><span style=3D"color: #000;" cl=
ass=3D"styled-by-prettify"> </span><span style=3D"color: #066;" class=3D"st=
yled-by-prettify">2.1f</span><span style=3D"color: #660;" class=3D"styled-b=
y-prettify">);</span><span style=3D"color: #000;" class=3D"styled-by-pretti=
fy"> </span><span style=3D"color: #800;" class=3D"styled-by-prettify">// no=
t compilable</span><span style=3D"color: #000;" class=3D"styled-by-prettify=
"><br></span></div></code></div><div><br><br>On Tuesday, April 24, 2018 at =
3:31:29 PM UTC+8, Jeff Hammond wrote:<blockquote class=3D"gmail_quote" styl=
e=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left:=
1ex;"><div dir=3D"ltr"><a href=3D"http://en.cppreference.com/w/cpp/numeric=
/math/fmod" target=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D'=
http://www.google.com/url?q\x3dhttp%3A%2F%2Fen.cppreference.com%2Fw%2Fcpp%2=
Fnumeric%2Fmath%2Ffmod\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFeKjMKYlI0hR=
XiXxDaNT2ryT1fjg';return true;" onclick=3D"this.href=3D'http://www.google.c=
om/url?q\x3dhttp%3A%2F%2Fen.cppreference.com%2Fw%2Fcpp%2Fnumeric%2Fmath%2Ff=
mod\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFeKjMKYlI0hRXiXxDaNT2ryT1fjg';r=
eturn true;">http://en.cppreference.com/w/<wbr>cpp/numeric/math/fmod</a>?<b=
r></div><div><br><div class=3D"gmail_quote">On Tue, Apr 24, 2018 at 10:07 A=
M, <span dir=3D"ltr"><<a href=3D"javascript:" target=3D"_blank" gdf-obf=
uscated-mailto=3D"XZkXFHfhAwAJ" rel=3D"nofollow" onmousedown=3D"this.href=
=3D'javascript:';return true;" onclick=3D"this.href=3D'javascript:';return =
true;">ryan...@digipen.edu</a>></span> wrote:<br><blockquote class=3D"gm=
ail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-le=
ft:1ex"><div dir=3D"ltr">I<span style=3D"color:rgb(29,33,41);font-family:He=
lvetica,Arial,sans-serif;font-size:14px"> think that it is discriminat=
ory that integers have modulus operators but floats do not.</span><div><spa=
n style=3D"color:rgb(29,33,41);font-family:Helvetica,Arial,sans-serif;font-=
size:14px">It is unacceptable, and that is my opinion.</span></div><div><sp=
an style=3D"color:rgb(29,33,41);font-family:Helvetica,Arial,sans-serif;font=
-size:14px"><br></span></div><div><span style=3D"color:rgb(29,33,41);font-f=
amily:Helvetica,Arial,sans-serif;font-size:14px">I propose we add the modul=
us operator to floating point types.</span></div></div><span><font color=3D=
"#888888">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
XZkXFHfhAwAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D'javascript:';ret=
urn true;" onclick=3D"this.href=3D'javascript:';return true;">std-proposal.=
...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"XZkXFHfhAwAJ" rel=3D"nofollow" onmousedown=3D"=
this.href=3D'javascript:';return true;" onclick=3D"this.href=3D'javascript:=
';return true;">std-pr...@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank" =
rel=3D"nofollow" onmousedown=3D"this.href=3D'https://groups.google.com/a/is=
ocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%40isocp=
p.org?utm_medium\x3demail\x26utm_source\x3dfooter';return true;" onclick=3D=
"this.href=3D'https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/=
87b7dbad-2d98-4e1a-899e-4e5342691465%40isocpp.org?utm_medium\x3demail\x26ut=
m_source\x3dfooter';return true;">https://groups.google.com/a/<wbr>isocpp.o=
rg/d/msgid/std-<wbr>proposals/87b7dbad-2d98-4e1a-<wbr>899e-4e5342691465%40i=
socpp.org</a><wbr>.<br>
</font></span></blockquote></div><br><br clear=3D"all"><div><br></div>-- <b=
r><div>Jeff Hammond<br><a href=3D"javascript:" target=3D"_blank" gdf-obfusc=
ated-mailto=3D"XZkXFHfhAwAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D'j=
avascript:';return true;" onclick=3D"this.href=3D'javascript:';return true;=
">jeff.s...@gmail.com</a><br><a href=3D"http://jeffhammond.github.io/" targ=
et=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D'http://www.googl=
e.com/url?q\x3dhttp%3A%2F%2Fjeffhammond.github.io%2F\x26sa\x3dD\x26sntz\x3d=
1\x26usg\x3dAFQjCNFjRmVnG_zjh9sinCbjcFRCVwxZrQ';return true;" onclick=3D"th=
is.href=3D'http://www.google.com/url?q\x3dhttp%3A%2F%2Fjeffhammond.github.i=
o%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFjRmVnG_zjh9sinCbjcFRCVwxZrQ';=
return true;">http://jeffhammond.github.io/</a></div>
</div>
</blockquote></div></div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups "=
ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.goo=
gle.com/a/isocpp.org/d/msgid/std-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3f=
de77%40isocpp.org</a>.<br>
<br><!--end of _originalContent --></div></body></html>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/20180424102929.5099602.62637.51047%40=
gmail.com?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.com=
/a/isocpp.org/d/msgid/std-proposals/20180424102929.5099602.62637.51047%40gm=
ail.com</a>.<br />
.
Author: "dgutson ." <danielgutson@gmail.com>
Date: Tue, 24 Apr 2018 10:35:44 +0000
Raw View
--001a1144d31e2d5131056a95b805
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
(Same for std::remainder?)
El mar., 24 de abril de 2018 7:29, Tony V E <tvaneerd@gmail.com> escribi=C3=
=B3:
> Would you be equally happy if fmod was made constexpr?
> (instead of % for floats)
>
> Sent from my BlackBerry portable Babbage Device
> *From: *ryan.ang@digipen.edu
> *Sent: *Tuesday, April 24, 2018 3:47 AM
> *To: *ISO C++ Standard - Future Proposals
> *Reply To: *std-proposals@isocpp.org
> *Subject: *Re: [std-proposals] Add the modulus operator to floating point
> types.
>
> constexpr float f =3D 13.f % 2.1f; // f =3D=3D 0.4
> constexpr float f =3D std::fmod(13.f, 2.1f); // not compilable
>
>
> On Tuesday, April 24, 2018 at 3:31:29 PM UTC+8, Jeff Hammond wrote:
>>
>> http://en.cppreference.com/w/cpp/numeric/math/fmod?
>>
>> On Tue, Apr 24, 2018 at 10:07 AM, <ryan...@digipen.edu> wrote:
>>
>>> I think that it is discriminatory that integers have modulus operators
>>> but floats do not.
>>> It is unacceptable, and that is my opinion.
>>>
>>> I propose we add the modulus operator to floating point types.
>>>
>>> --
>>> 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 email to std-proposal...@isocpp.org.
>>> To post to this group, send email to std-pr...@isocpp.org.
>>> To view this discussion on the web visit
>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2=
d98-4e1a-899e-4e5342691465%40isocpp.org
>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/87b7dbad-=
2d98-4e1a-899e-4e5342691465%40isocpp.org?utm_medium=3Demail&utm_source=3Dfo=
oter>
>>> .
>>>
>>
>>
>>
>> --
>> Jeff Hammond
>> jeff.s...@gmail.com
>> http://jeffhammond.github.io/
>>
> --
> 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
> email 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/90618fc9-0eb=
2-42bd-ad8e-3c983a3fde77%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/90618fc9-0e=
b2-42bd-ad8e-3c983a3fde77%40isocpp.org?utm_medium=3Demail&utm_source=3Dfoot=
er>
> .
>
> --
> 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
> email 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/201804241029=
29.5099602.62637.51047%40gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/20180424102=
929.5099602.62637.51047%40gmail.com?utm_medium=3Demail&utm_source=3Dfooter>
> .
>
--=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/CAFdMc-3nqENuRseaZ545apAjj7L5QgwZ440ceZQ0vWO%3D-=
yHm2g%40mail.gmail.com.
--001a1144d31e2d5131056a95b805
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"auto">(Same for std::remainder?)</div><br><div class=3D"gmail_q=
uote"><div dir=3D"ltr">El mar., 24 de abril de 2018 7:29, Tony V E <<a h=
ref=3D"mailto:tvaneerd@gmail.com">tvaneerd@gmail.com</a>> escribi=C3=B3:=
<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord=
er-left:1px #ccc solid;padding-left:1ex"><div lang=3D"en-US" style=3D"backg=
round-color:rgb(255,255,255);line-height:initial"> =
<div style=3D"=
width:100%;font-size:initial;font-family:Calibri,'Slate Pro',sans-s=
erif,sans-serif;color:rgb(31,73,125);text-align:initial;background-color:rg=
b(255,255,255)">Would you be equally happy if fmod was made constexpr?=C2=
=A0</div><div style=3D"width:100%;font-size:initial;font-family:Calibri,=
9;Slate Pro',sans-serif,sans-serif;color:rgb(31,73,125);text-align:init=
ial;background-color:rgb(255,255,255)">(instead of % for floats)</div> =
=
<div style=3D"width:10=
0%;font-size:initial;font-family:Calibri,'Slate Pro',sans-serif,san=
s-serif;color:rgb(31,73,125);text-align:initial;background-color:rgb(255,25=
5,255)"><br style=3D"display:initial"></div> =
=
=
<div style=3D"font-size:initial;font-family:Calibri,'Slat=
e Pro',sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;ba=
ckground-color:rgb(255,255,255)">Sent=C2=A0from=C2=A0my=C2=A0BlackBerry=C2=
=A0portable=C2=A0Babbage=C2=A0Device</div> =
=
<tabl=
e width=3D"100%" style=3D"background-color:white;border-spacing:0px"> <tbod=
y><tr><td colspan=3D"2" style=3D"font-size:initial;text-align:initial;backg=
round-color:rgb(255,255,255)"> <div style=3D"bord=
er-style:solid none none;border-top-color:rgb(181,196,223);border-top-width=
:1pt;padding:3pt 0in 0in;font-family:Tahoma,'BB Alpha Sans','Sl=
ate Pro';font-size:10pt"> <div><b>From: </b><a href=3D"mailto:ryan.ang=
@digipen.edu" target=3D"_blank" rel=3D"noreferrer">ryan.ang@digipen.edu</a>=
</div><div><b>Sent: </b>Tuesday, April 24, 2018 3:47 AM</div><div><b>To: </=
b>ISO C++ Standard - Future Proposals</div><div><b>Reply To: </b><a href=3D=
"mailto:std-proposals@isocpp.org" target=3D"_blank" rel=3D"noreferrer">std-=
proposals@isocpp.org</a></div><div><b>Subject: </b>Re: [std-proposals] Add =
the modulus operator to floating point types.</div></div></td></tr></tbody>=
</table><div style=3D"border-style:solid none none;border-top-color:rgb(186=
,188,209);border-top-width:1pt;font-size:initial;text-align:initial;backgro=
und-color:rgb(255,255,255)"></div><br><div id=3D"m_-1542411681570675624_ori=
ginalContent"><div dir=3D"ltr"><div class=3D"m_-1542411681570675624prettypr=
int" style=3D"background-color:rgb(250,250,250);border-color:rgb(187,187,18=
7);border-style:solid;border-width:1px;word-wrap:break-word"><code class=3D=
"m_-1542411681570675624prettyprint"><div class=3D"m_-1542411681570675624sub=
prettyprint"><span style=3D"color:#008" class=3D"m_-1542411681570675624styl=
ed-by-prettify">constexpr</span><span style=3D"color:#000" class=3D"m_-1542=
411681570675624styled-by-prettify"> </span><span style=3D"color:#008" class=
=3D"m_-1542411681570675624styled-by-prettify">float</span><span style=3D"co=
lor:#000" class=3D"m_-1542411681570675624styled-by-prettify"> f </span><spa=
n style=3D"color:#660" class=3D"m_-1542411681570675624styled-by-prettify">=
=3D</span><span style=3D"color:#000" class=3D"m_-1542411681570675624styled-=
by-prettify"> </span><span style=3D"color:#066" class=3D"m_-154241168157067=
5624styled-by-prettify">13.f</span><span style=3D"color:#000" class=3D"m_-1=
542411681570675624styled-by-prettify"> </span><span style=3D"color:#660" cl=
ass=3D"m_-1542411681570675624styled-by-prettify">%</span><span style=3D"col=
or:#000" class=3D"m_-1542411681570675624styled-by-prettify"> </span><span s=
tyle=3D"color:#066" class=3D"m_-1542411681570675624styled-by-prettify">2.1f=
</span><span style=3D"color:#660" class=3D"m_-1542411681570675624styled-by-=
prettify">;</span><span style=3D"color:#000" class=3D"m_-154241168157067562=
4styled-by-prettify"> </span><span style=3D"color:#800" class=3D"m_-1542411=
681570675624styled-by-prettify">// f =3D=3D 0.4</span><span style=3D"color:=
#000" class=3D"m_-1542411681570675624styled-by-prettify"><br></span><span s=
tyle=3D"color:#008" class=3D"m_-1542411681570675624styled-by-prettify">cons=
texpr</span><span style=3D"color:#000" class=3D"m_-1542411681570675624style=
d-by-prettify"> </span><span style=3D"color:#008" class=3D"m_-1542411681570=
675624styled-by-prettify">float</span><span style=3D"color:#000" class=3D"m=
_-1542411681570675624styled-by-prettify"> f </span><span style=3D"color:#66=
0" class=3D"m_-1542411681570675624styled-by-prettify">=3D</span><span style=
=3D"color:#000" class=3D"m_-1542411681570675624styled-by-prettify"> std</sp=
an><span style=3D"color:#660" class=3D"m_-1542411681570675624styled-by-pret=
tify">::</span><span style=3D"color:#000" class=3D"m_-1542411681570675624st=
yled-by-prettify">fmod</span><span style=3D"color:#660" class=3D"m_-1542411=
681570675624styled-by-prettify">(</span><span style=3D"color:#066" class=3D=
"m_-1542411681570675624styled-by-prettify">13.f</span><span style=3D"color:=
#660" class=3D"m_-1542411681570675624styled-by-prettify">,</span><span styl=
e=3D"color:#000" class=3D"m_-1542411681570675624styled-by-prettify"> </span=
><span style=3D"color:#066" class=3D"m_-1542411681570675624styled-by-pretti=
fy">2.1f</span><span style=3D"color:#660" class=3D"m_-1542411681570675624st=
yled-by-prettify">);</span><span style=3D"color:#000" class=3D"m_-154241168=
1570675624styled-by-prettify"> </span><span style=3D"color:#800" class=3D"m=
_-1542411681570675624styled-by-prettify">// not compilable</span><span styl=
e=3D"color:#000" class=3D"m_-1542411681570675624styled-by-prettify"><br></s=
pan></div></code></div><div><br><br>On Tuesday, April 24, 2018 at 3:31:29 P=
M UTC+8, Jeff Hammond wrote:<blockquote class=3D"gmail_quote" style=3D"marg=
in:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div di=
r=3D"ltr"><a href=3D"http://en.cppreference.com/w/cpp/numeric/math/fmod" re=
l=3D"nofollow noreferrer" target=3D"_blank">http://en.cppreference.com/w/cp=
p/numeric/math/fmod</a>?<br></div><div><br><div class=3D"gmail_quote">On Tu=
e, Apr 24, 2018 at 10:07 AM, <span dir=3D"ltr"><<a rel=3D"nofollow nore=
ferrer">ryan...@digipen.edu</a>></span> wrote:<br><blockquote class=3D"g=
mail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-l=
eft:1ex"><div dir=3D"ltr">I<span style=3D"color:rgb(29,33,41);font-family:H=
elvetica,Arial,sans-serif;font-size:14px">=C2=A0think that it is discrimina=
tory that integers have modulus operators but floats do not.</span><div><sp=
an style=3D"color:rgb(29,33,41);font-family:Helvetica,Arial,sans-serif;font=
-size:14px">It is unacceptable, and that is my opinion.</span></div><div><s=
pan style=3D"color:rgb(29,33,41);font-family:Helvetica,Arial,sans-serif;fon=
t-size:14px"><br></span></div><div><span style=3D"color:rgb(29,33,41);font-=
family:Helvetica,Arial,sans-serif;font-size:14px">I propose we add the modu=
lus operator to floating point types.</span></div></div><span><font color=
=3D"#888888">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a rel=3D"nofollow noreferrer">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow noreferrer">std-pr.=
...@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" rel=3D"nofollow no=
referrer" target=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/=
std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%40isocpp.org</a>.<br>
</font></span></blockquote></div><br><br clear=3D"all"><div><br></div>-- <b=
r><div>Jeff Hammond<br><a rel=3D"nofollow noreferrer">jeff.s...@gmail.com</=
a><br><a href=3D"http://jeffhammond.github.io/" rel=3D"nofollow noreferrer"=
target=3D"_blank">http://jeffhammond.github.io/</a></div>
</div>
</blockquote></div></div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank" rel=3D"noreferrer">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank" rel=3D"noreferrer">std-proposals@isocpp.org</a>.<br=
>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank" =
rel=3D"noreferrer">https://groups.google.com/a/isocpp.org/d/msgid/std-propo=
sals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%40isocpp.org</a>.<br>
<br></div></div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank" rel=3D"noreferrer">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank" rel=3D"noreferrer">std-proposals@isocpp.org</a>.<br=
>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/20180424102929.5099602.62637.51047%40=
gmail.com?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank" rel=
=3D"noreferrer">https://groups.google.com/a/isocpp.org/d/msgid/std-proposal=
s/20180424102929.5099602.62637.51047%40gmail.com</a>.<br>
</blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAFdMc-3nqENuRseaZ545apAjj7L5QgwZ440c=
eZQ0vWO%3D-yHm2g%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAFdMc-3nqENuRs=
eaZ545apAjj7L5QgwZ440ceZQ0vWO%3D-yHm2g%40mail.gmail.com</a>.<br />
--001a1144d31e2d5131056a95b805--
.
Author: Jeff Hammond <jeff.science@gmail.com>
Date: Tue, 24 Apr 2018 13:43:14 +0300
Raw View
--001a1137ca2e8820c3056a95d38e
Content-Type: text/plain; charset="UTF-8"
Did you spend any time researching this topic before you posted? The issue
with your example isn't fmod but constexpr in <cmath> and the proposal to
support this is linked from the top google search hit for "constexpr c++
cmath".
https://stackoverflow.com/questions/42189190/why-doesnt-
the-c-standard-library-provide-constexpr-versions-of-the-cmath-fun points
to http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0533r0.pdf,
which contains
constexpr float fmod(float x, float y); // see [library.c]
constexpr double fmod(double x, double y);
constexpr long double fmod(long double x, long double y); // see [library.c]
constexpr float fmodf(float x, float y);
constexpr long double fmodl(long double x, long double y);
On Tue, Apr 24, 2018 at 10:47 AM, <ryan.ang@digipen.edu> wrote:
> constexpr float f = 13.f % 2.1f; // f == 0.4
> constexpr float f = std::fmod(13.f, 2.1f); // not compilable
>
>
> On Tuesday, April 24, 2018 at 3:31:29 PM UTC+8, Jeff Hammond wrote:
>>
>> http://en.cppreference.com/w/cpp/numeric/math/fmod?
>>
>> On Tue, Apr 24, 2018 at 10:07 AM, <ryan...@digipen.edu> wrote:
>>
>>> I think that it is discriminatory that integers have modulus operators
>>> but floats do not.
>>> It is unacceptable, and that is my opinion.
>>>
>>> I propose we add the modulus operator to floating point types.
>>>
>>> --
>>> 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 email to std-proposal...@isocpp.org.
>>> To post to this group, send email to std-pr...@isocpp.org.
>>> To view this discussion on the web visit https://groups.google.com/a/is
>>> ocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e534
>>> 2691465%40isocpp.org
>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%40isocpp.org?utm_medium=email&utm_source=footer>
>>> .
>>>
>>
>>
>>
>> --
>> Jeff Hammond
>> jeff.s...@gmail.com
>> http://jeffhammond.github.io/
>>
> --
> 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
> email 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/is
> ocpp.org/d/msgid/std-proposals/90618fc9-0eb2-42bd-ad8e-
> 3c983a3fde77%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
Jeff Hammond
jeff.science@gmail.com
http://jeffhammond.github.io/
--
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 email 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/CAGKz%3DuLrxiuacq55hjkdfsuOT%3DxC-s5v4VXb7i7QQnzZbsVLgA%40mail.gmail.com.
--001a1137ca2e8820c3056a95d38e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>Did you spend any time researching this topic before =
you posted?=C2=A0 The issue with your example isn't fmod but constexpr =
in <cmath> and the proposal to support this is linked from the top go=
ogle search hit for "constexpr c++ cmath".</div><div><br></div><a=
href=3D"https://stackoverflow.com/questions/42189190/why-doesnt-the-c-stan=
dard-library-provide-constexpr-versions-of-the-cmath-fun" target=3D"_blank"=
>https://stackoverflow.com/<wbr>questions/42189190/why-doesnt-<wbr>the-c-st=
andard-library-<wbr>provide-constexpr-versions-of-<wbr>the-cmath-fun</a> po=
ints to=C2=A0<a href=3D"http://www.open-std.org/jtc1/sc22/wg21/docs/papers/=
2017/p0533r0.pdf" target=3D"_blank">http://www.open-std.org/<wbr>jtc1/sc22/=
wg21/docs/papers/<wbr>2017/p0533r0.pdf</a>, which contains<div><br></div><d=
iv>constexpr float fmod(float x, float y); // see [library.c]</div><div>con=
stexpr double fmod(double x, double y);</div><div>constexpr long double fmo=
d(long double x, long double y); // see [library.c]</div><div>constexpr flo=
at fmodf(float x, float y);</div><div>constexpr long double fmodl(long doub=
le x, long double y);<div><div class=3D"gmail_extra"><br><div class=3D"gmai=
l_quote">On Tue, Apr 24, 2018 at 10:47 AM, <span dir=3D"ltr"><<a href=
=3D"mailto:ryan.ang@digipen.edu" target=3D"_blank">ryan.ang@digipen.edu</a>=
></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margin:0px=
0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><di=
v dir=3D"ltr"><div class=3D"gmail-m_4499725474510464248gmail-m_714818367141=
3222082prettyprint" style=3D"background-color:rgb(250,250,250);border-color=
:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:break-word"=
><code class=3D"gmail-m_4499725474510464248gmail-m_7148183671413222082prett=
yprint"><div class=3D"gmail-m_4499725474510464248gmail-m_714818367141322208=
2subprettyprint"><span style=3D"color:rgb(0,0,136)" class=3D"gmail-m_449972=
5474510464248gmail-m_7148183671413222082styled-by-prettify">constexpr</span=
><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_4499725474510464248gmail=
-m_7148183671413222082styled-by-prettify"> </span><span style=3D"color:rgb(=
0,0,136)" class=3D"gmail-m_4499725474510464248gmail-m_7148183671413222082st=
yled-by-prettify">float</span><span style=3D"color:rgb(0,0,0)" class=3D"gma=
il-m_4499725474510464248gmail-m_7148183671413222082styled-by-prettify"> f <=
/span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_449972547451046=
4248gmail-m_7148183671413222082styled-by-prettify">=3D</span><span style=3D=
"color:rgb(0,0,0)" class=3D"gmail-m_4499725474510464248gmail-m_714818367141=
3222082styled-by-prettify"> </span><span style=3D"color:rgb(0,102,102)" cla=
ss=3D"gmail-m_4499725474510464248gmail-m_7148183671413222082styled-by-prett=
ify">13.f</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_449972547=
4510464248gmail-m_7148183671413222082styled-by-prettify"> </span><span styl=
e=3D"color:rgb(102,102,0)" class=3D"gmail-m_4499725474510464248gmail-m_7148=
183671413222082styled-by-prettify">%</span><span style=3D"color:rgb(0,0,0)"=
class=3D"gmail-m_4499725474510464248gmail-m_7148183671413222082styled-by-p=
rettify"> </span><span style=3D"color:rgb(0,102,102)" class=3D"gmail-m_4499=
725474510464248gmail-m_7148183671413222082styled-by-prettify">2.1f</span><s=
pan style=3D"color:rgb(102,102,0)" class=3D"gmail-m_4499725474510464248gmai=
l-m_7148183671413222082styled-by-prettify">;</span><span style=3D"color:rgb=
(0,0,0)" class=3D"gmail-m_4499725474510464248gmail-m_7148183671413222082sty=
led-by-prettify"> </span><span style=3D"color:rgb(136,0,0)" class=3D"gmail-=
m_4499725474510464248gmail-m_7148183671413222082styled-by-prettify">// f =
=3D=3D 0.4</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_44997254=
74510464248gmail-m_7148183671413222082styled-by-prettify"><br></span><span =
style=3D"color:rgb(0,0,136)" class=3D"gmail-m_4499725474510464248gmail-m_71=
48183671413222082styled-by-prettify">constexpr</span><span style=3D"color:r=
gb(0,0,0)" class=3D"gmail-m_4499725474510464248gmail-m_7148183671413222082s=
tyled-by-prettify"> </span><span style=3D"color:rgb(0,0,136)" class=3D"gmai=
l-m_4499725474510464248gmail-m_7148183671413222082styled-by-prettify">float=
</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_449972547451046424=
8gmail-m_7148183671413222082styled-by-prettify"> f </span><span style=3D"co=
lor:rgb(102,102,0)" class=3D"gmail-m_4499725474510464248gmail-m_71481836714=
13222082styled-by-prettify">=3D</span><span style=3D"color:rgb(0,0,0)" clas=
s=3D"gmail-m_4499725474510464248gmail-m_7148183671413222082styled-by-pretti=
fy"> std</span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_449972=
5474510464248gmail-m_7148183671413222082styled-by-prettify">::</span><span =
style=3D"color:rgb(0,0,0)" class=3D"gmail-m_4499725474510464248gmail-m_7148=
183671413222082styled-by-prettify">fmod</span><span style=3D"color:rgb(102,=
102,0)" class=3D"gmail-m_4499725474510464248gmail-m_7148183671413222082styl=
ed-by-prettify">(</span><span style=3D"color:rgb(0,102,102)" class=3D"gmail=
-m_4499725474510464248gmail-m_7148183671413222082styled-by-prettify">13.f</=
span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_4499725474510464=
248gmail-m_7148183671413222082styled-by-prettify">,</span><span style=3D"co=
lor:rgb(0,0,0)" class=3D"gmail-m_4499725474510464248gmail-m_714818367141322=
2082styled-by-prettify"> </span><span style=3D"color:rgb(0,102,102)" class=
=3D"gmail-m_4499725474510464248gmail-m_7148183671413222082styled-by-prettif=
y">2.1f</span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_4499725=
474510464248gmail-m_7148183671413222082styled-by-prettify">);</span><span s=
tyle=3D"color:rgb(0,0,0)" class=3D"gmail-m_4499725474510464248gmail-m_71481=
83671413222082styled-by-prettify"> </span><span style=3D"color:rgb(136,0,0)=
" class=3D"gmail-m_4499725474510464248gmail-m_7148183671413222082styled-by-=
prettify">// not compilable</span><span style=3D"color:rgb(0,0,0)" class=3D=
"gmail-m_4499725474510464248gmail-m_7148183671413222082styled-by-prettify">=
<br></span></div></code></div><div><span class=3D"gmail-m_44997254745104642=
48gmail-"><br><br>On Tuesday, April 24, 2018 at 3:31:29 PM UTC+8, Jeff Hamm=
ond wrote:</span><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px =
0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=
=3D"ltr"><a href=3D"http://en.cppreference.com/w/cpp/numeric/math/fmod" rel=
=3D"nofollow" target=3D"_blank">http://en.cppreference.com/w/c<wbr>pp/numer=
ic/math/fmod</a>?<br></div><div><br><div class=3D"gmail_quote"><span class=
=3D"gmail-m_4499725474510464248gmail-">On Tue, Apr 24, 2018 at 10:07 AM, <=
span dir=3D"ltr"><<a rel=3D"nofollow">ryan...@digipen.edu</a>></span>=
wrote:<br></span><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px=
0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span c=
lass=3D"gmail-m_4499725474510464248gmail-"><div dir=3D"ltr">I<span style=3D=
"color:rgb(29,33,41);font-family:Helvetica,Arial,sans-serif;font-size:14px"=
>=C2=A0think that it is discriminatory that integers have modulus operators=
but floats do not.</span><div><span style=3D"color:rgb(29,33,41);font-fami=
ly:Helvetica,Arial,sans-serif;font-size:14px">It is unacceptable, and that =
is my opinion.</span></div><div><span style=3D"color:rgb(29,33,41);font-fam=
ily:Helvetica,Arial,sans-serif;font-size:14px"><br></span></div><div><span =
style=3D"color:rgb(29,33,41);font-family:Helvetica,Arial,sans-serif;font-si=
ze:14px">I propose we add the modulus operator to floating point types.</sp=
an></div></div></span><span><font color=3D"#888888"><span class=3D"gmail-m_=
4499725474510464248gmail-">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br></span>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a rel=3D"nofollow">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@isocpp.o=
rg</a>.<span class=3D"gmail-m_4499725474510464248gmail-"><br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" rel=3D"nofollow" t=
arget=3D"_blank">https://groups.google.com/a/is<wbr>ocpp.org/d/msgid/std-pr=
oposals<wbr>/87b7dbad-2d98-4e1a-899e-4e534<wbr>2691465%40isocpp.org</a>.<br=
>
</span></font></span></blockquote></div><br><br clear=3D"all"><div><br></di=
v>-- <br><div>Jeff Hammond<br><a rel=3D"nofollow">jeff.s...@gmail.com</a><b=
r><a href=3D"http://jeffhammond.github.io/" rel=3D"nofollow" target=3D"_bla=
nk">http://jeffhammond.github.io/</a></div>
</div>
</blockquote></div></div><span class=3D"gmail-m_4499725474510464248gmail-">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@isoc<wbr>pp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br></span>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/is<wbr>ocpp.org/d/msgid/std-proposals<wbr>/9061=
8fc9-0eb2-42bd-ad8e-<wbr>3c983a3fde77%40isocpp.org</a>.<br>
</blockquote></div><br><br clear=3D"all"><div><br></div>-- <br><div class=
=3D"gmail-m_4499725474510464248gmail_signature">Jeff Hammond<br><a href=3D"=
mailto:jeff.science@gmail.com" target=3D"_blank">jeff.science@gmail.com</a>=
<br><a href=3D"http://jeffhammond.github.io/" target=3D"_blank">http://jeff=
hammond.github.io/</a></div>
</div></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAGKz%3DuLrxiuacq55hjkdfsuOT%3DxC-s5v=
4VXb7i7QQnzZbsVLgA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAGKz%3DuLrxi=
uacq55hjkdfsuOT%3DxC-s5v4VXb7i7QQnzZbsVLgA%40mail.gmail.com</a>.<br />
--001a1137ca2e8820c3056a95d38e--
.
Author: ryan.ang@digipen.edu
Date: Tue, 24 Apr 2018 03:55:52 -0700 (PDT)
Raw View
------=_Part_28821_352401138.1524567352571
Content-Type: multipart/alternative;
boundary="----=_Part_28822_315424635.1524567352572"
------=_Part_28822_315424635.1524567352572
Content-Type: text/plain; charset="UTF-8"
*Statement_X*: "The remainder can be thought of as the value that is lost
as a result of rounding down of the quotient."
*Wikipedia*: "In computing, the modulo operation finds the remainder after
division of one number by another." - Modulo Operation, Wikipedia
<https://en.wikipedia.org/wiki/Modulo_operation>
*Wikipedia* does not prohibit operating modulo on floating point numbers.
*Statement_X* happens to be true if the modulo operands are *integral*,
however, *Statement_X* does not define modulo.
What do you think?
On Tuesday, April 24, 2018 at 5:43:44 PM UTC+8, John McFarlane wrote:
>
> The remainder can be thought of as the value that is lost as a result of
> rounding down of the quotient. The rounding occurs because integers have a
> fixed resolution of 1. Floats do not.
>
> For integer division, if n/d=q and n%d=r then if follows that q*d+r=n. So
> having a remainder of 0.4f in your example only makes sense if 13.f / 2.1f
> == 6 and that would change the behavior of floating-point division.
>
> On Tue, Apr 24, 2018 at 12:47 AM <ryan...@digipen.edu <javascript:>>
> wrote:
>
>> constexpr float f = 13.f % 2.1f; // f == 0.4
>> constexpr float f = std::fmod(13.f, 2.1f); // not compilable
>>
>>
>> On Tuesday, April 24, 2018 at 3:31:29 PM UTC+8, Jeff Hammond wrote:
>>
>>> http://en.cppreference.com/w/cpp/numeric/math/fmod?
>>>
>>> On Tue, Apr 24, 2018 at 10:07 AM, <ryan...@digipen.edu> wrote:
>>>
>> I think that it is discriminatory that integers have modulus operators
>>>> but floats do not.
>>>> It is unacceptable, and that is my opinion.
>>>>
>>>> I propose we add the modulus operator to floating point types.
>>>>
>>> --
>>>> 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 email to std-proposal...@isocpp.org.
>>>> To post to this group, send email to std-pr...@isocpp.org.
>>>
>>>
>>>> To view this discussion on the web visit
>>>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%40isocpp.org
>>>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%40isocpp.org?utm_medium=email&utm_source=footer>
>>>> .
>>>>
>>>
>>>
>>>
>>> --
>>> Jeff Hammond
>>> jeff.s...@gmail.com
>>> http://jeffhammond.github.io/
>>>
>> --
>> 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
>> email to std-proposal...@isocpp.org <javascript:>.
>> To post to this group, send email to std-pr...@isocpp.org <javascript:>.
>> To view this discussion on the web visit
>> https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%40isocpp.org
>> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%40isocpp.org?utm_medium=email&utm_source=footer>
>> .
>>
>
--
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 email 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/9ed01240-cfd9-4e92-95b7-ddfdfcd4a99c%40isocpp.org.
------=_Part_28822_315424635.1524567352572
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div><b><br></b></div><div><b>Statement_X</b>: "The r=
emainder can be thought of as the value that is lost as a result of roundin=
g down of the quotient."</div><div><b>Wikipedia</b>: "In computin=
g, the modulo operation finds the remainder after division of one number by=
another." - <a href=3D"https://en.wikipedia.org/wiki/Modulo_operation=
">Modulo Operation, Wikipedia</a></div><div><br></div><div><b>Wikipedia</b>=
=C2=A0does not prohibit operating modulo on floating point numbers.<br></di=
v><div><b>Statement_X</b>=C2=A0happens to be true if the modulo operands ar=
e <i><u>integral</u></i>, however,=C2=A0<b>Statement_X</b>=C2=A0does not de=
fine modulo.</div><div>What do you think?</div><div><br>On Tuesday, April 2=
4, 2018 at 5:43:44 PM UTC+8, John McFarlane wrote:<blockquote class=3D"gmai=
l_quote" style=3D"margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;=
padding-left: 1ex;"><div dir=3D"ltr"><div>The remainder can be thought of a=
s the value that is lost as a result of rounding down of the quotient.=20
The rounding occurs because integers have a fixed resolution of 1. Floats d=
o not.<br></div><div><br></div><div>For integer division, if n/d=3Dq
and n%d=3Dr then if follows that q*d+r=3Dn.=20
So having a remainder of 0.4f in your example only makes sense if 13.f / 2.=
1f =3D=3D 6 and that would change the behavior of floating-point division.<=
br><br><div class=3D"gmail_quote"><div dir=3D"ltr">On Tue, Apr 24, 2018 at =
12:47 AM <<a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailt=
o=3D"_cx0n67oAwAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D'javascr=
ipt:';return true;" onclick=3D"this.href=3D'javascript:';return=
true;">ryan...@digipen.edu</a>> wrote:<br></div><blockquote class=3D"gm=
ail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-le=
ft:1ex"><div dir=3D"ltr"><div style=3D"background-color:rgb(250,250,250);bo=
rder-color:rgb(187,187,187);border-style:solid;border-width:1px;word-wrap:b=
reak-word"><code><div><span style=3D"color:#008">constexpr</span><span styl=
e=3D"color:#000"> </span><span style=3D"color:#008">float</span><span style=
=3D"color:#000"> f </span><span style=3D"color:#660">=3D</span><span style=
=3D"color:#000"> </span><span style=3D"color:#066">13.f</span><span style=
=3D"color:#000"> </span><span style=3D"color:#660">%</span><span style=3D"c=
olor:#000"> </span><span style=3D"color:#066">2.1f</span><span style=3D"col=
or:#660">;</span><span style=3D"color:#000"> </span><span style=3D"color:#8=
00">// f =3D=3D 0.4</span><span style=3D"color:#000"><br></span><span style=
=3D"color:#008">constexpr</span><span style=3D"color:#000"> </span><span st=
yle=3D"color:#008">float</span><span style=3D"color:#000"> f </span><span s=
tyle=3D"color:#660">=3D</span><span style=3D"color:#000"> std</span><span s=
tyle=3D"color:#660">::</span><span style=3D"color:#000">fmod</span><span st=
yle=3D"color:#660">(</span><span style=3D"color:#066">13.f</span><span styl=
e=3D"color:#660">,</span><span style=3D"color:#000"> </span><span style=3D"=
color:#066">2.1f</span><span style=3D"color:#660">);</span><span style=3D"c=
olor:#000"> </span><span style=3D"color:#800">// not compilable</span><span=
style=3D"color:#000"><br></span></div></code></div></div><div dir=3D"ltr">=
<div><br><br>On Tuesday, April 24, 2018 at 3:31:29 PM UTC+8, Jeff Hammond w=
rote:</div></div><div dir=3D"ltr"><div><blockquote class=3D"gmail_quote" st=
yle=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1=
ex"><div dir=3D"ltr"><a href=3D"http://en.cppreference.com/w/cpp/numeric/ma=
th/fmod" rel=3D"nofollow" target=3D"_blank" onmousedown=3D"this.href=3D'=
;http://www.google.com/url?q\x3dhttp%3A%2F%2Fen.cppreference.com%2Fw%2Fcpp%=
2Fnumeric%2Fmath%2Ffmod\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFeKjMKYlI0h=
RXiXxDaNT2ryT1fjg';return true;" onclick=3D"this.href=3D'http://www=
..google.com/url?q\x3dhttp%3A%2F%2Fen.cppreference.com%2Fw%2Fcpp%2Fnumeric%2=
Fmath%2Ffmod\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFeKjMKYlI0hRXiXxDaNT2r=
yT1fjg';return true;">http://en.cppreference.com/w/<wbr>cpp/numeric/mat=
h/fmod</a>?<br></div><div><br></div></blockquote></div></div><div dir=3D"lt=
r"><div><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8=
ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class=3D"gmail_qu=
ote">On Tue, Apr 24, 2018 at 10:07 AM, <span dir=3D"ltr"><<a rel=3D"nof=
ollow">ryan...@digipen.edu</a>></span> wrote:<br></div></div></blockquot=
e></div></div><div dir=3D"ltr"><div><blockquote class=3D"gmail_quote" style=
=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"=
><div><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D=
"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D=
"ltr">I<span style=3D"color:rgb(29,33,41);font-family:Helvetica,Arial,sans-=
serif;font-size:14px">=C2=A0think that it is discriminatory that integers h=
ave modulus operators but floats do not.</span><div><span style=3D"color:rg=
b(29,33,41);font-family:Helvetica,Arial,sans-serif;font-size:14px">It is un=
acceptable, and that is my opinion.</span></div><div><span style=3D"color:r=
gb(29,33,41);font-family:Helvetica,Arial,sans-serif;font-size:14px"><br></s=
pan></div><div><span style=3D"color:rgb(29,33,41);font-family:Helvetica,Ari=
al,sans-serif;font-size:14px">I propose we add the modulus operator to floa=
ting point types.</span></div></div></blockquote></div></div></blockquote><=
/div></div><div dir=3D"ltr"><div><blockquote class=3D"gmail_quote" style=3D=
"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><d=
iv><div class=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span><font co=
lor=3D"#888888">
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br></font></span></bl=
ockquote></div></div></blockquote></div></div><div dir=3D"ltr"><div><blockq=
uote class=3D"gmail_quote" style=3D"margin:0;margin-left:0.8ex;border-left:=
1px #ccc solid;padding-left:1ex"><div><div class=3D"gmail_quote"><blockquot=
e class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc sol=
id;padding-left:1ex"><span><font color=3D"#888888">
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a rel=3D"nofollow">std-proposal...@isocpp.org</a>.<br>
To post to this group, send email to <a rel=3D"nofollow">std-pr...@isocpp.o=
rg</a>.</font></span></blockquote></div></div></blockquote></div></div><div=
dir=3D"ltr"><div><blockquote class=3D"gmail_quote" style=3D"margin:0;margi=
n-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class=
=3D"gmail_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8=
ex;border-left:1px #ccc solid;padding-left:1ex"><span><font color=3D"#88888=
8"><br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" rel=3D"nofollow" t=
arget=3D"_blank" onmousedown=3D"this.href=3D'https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter';return true;" on=
click=3D"this.href=3D'https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/87b7dbad-2d98-4e1a-899e-4e5342691465%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter';return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/87b7dbad-2d98-4e1a-<wbr>899e-=
4e5342691465%40isocpp.org</a><wbr>.<br>
</font></span></blockquote></div></div></blockquote></div></div><div dir=3D=
"ltr"><div><blockquote class=3D"gmail_quote" style=3D"margin:0;margin-left:=
0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div class=3D"gmail=
_quote"><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border=
-left:1px #ccc solid;padding-left:1ex"><span></span></blockquote></div><br>=
<br clear=3D"all"><div><br></div>-- <br><div>Jeff Hammond<br><a rel=3D"nofo=
llow">jeff.s...@gmail.com</a><br><a href=3D"http://jeffhammond.github.io/" =
rel=3D"nofollow" target=3D"_blank" onmousedown=3D"this.href=3D'http://w=
ww.google.com/url?q\x3dhttp%3A%2F%2Fjeffhammond.github.io%2F\x26sa\x3dD\x26=
sntz\x3d1\x26usg\x3dAFQjCNFjRmVnG_zjh9sinCbjcFRCVwxZrQ';return true;" o=
nclick=3D"this.href=3D'http://www.google.com/url?q\x3dhttp%3A%2F%2Fjeff=
hammond.github.io%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNFjRmVnG_zjh9si=
nCbjcFRCVwxZrQ';return true;">http://jeffhammond.github.io/</a></div>
</div>
</blockquote></div></div>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"javascript:" target=3D"_blank" gdf-obfuscated-mailto=3D"=
_cx0n67oAwAJ" rel=3D"nofollow" onmousedown=3D"this.href=3D'javascript:&=
#39;;return true;" onclick=3D"this.href=3D'javascript:';return true=
;">std-proposal...@<wbr>isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"javascript:" target=3D"_bla=
nk" gdf-obfuscated-mailto=3D"_cx0n67oAwAJ" rel=3D"nofollow" onmousedown=3D"=
this.href=3D'javascript:';return true;" onclick=3D"this.href=3D'=
;javascript:';return true;">std-pr...@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank" =
rel=3D"nofollow" onmousedown=3D"this.href=3D'https://groups.google.com/=
a/isocpp.org/d/msgid/std-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%40i=
socpp.org?utm_medium\x3demail\x26utm_source\x3dfooter';return true;" on=
click=3D"this.href=3D'https://groups.google.com/a/isocpp.org/d/msgid/st=
d-proposals/90618fc9-0eb2-42bd-ad8e-3c983a3fde77%40isocpp.org?utm_medium\x3=
demail\x26utm_source\x3dfooter';return true;">https://groups.google.com=
/a/<wbr>isocpp.org/d/msgid/std-<wbr>proposals/90618fc9-0eb2-42bd-<wbr>ad8e-=
3c983a3fde77%40isocpp.org</a><wbr>.<br>
</blockquote></div></div></div>
</blockquote></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/9ed01240-cfd9-4e92-95b7-ddfdfcd4a99c%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/9ed01240-cfd9-4e92-95b7-ddfdfcd4a99c=
%40isocpp.org</a>.<br />
------=_Part_28822_315424635.1524567352572--
------=_Part_28821_352401138.1524567352571--
.
Author: ryan.ang@digipen.edu
Date: Tue, 24 Apr 2018 08:12:26 -0700 (PDT)
Raw View
------=_Part_29373_158374882.1524582746489
Content-Type: multipart/alternative;
boundary="----=_Part_29374_389105236.1524582746489"
------=_Part_29374_389105236.1524582746489
Content-Type: text/plain; charset="UTF-8"
I presume that *f* is floating-point, and *mod* is modulo, in std::*fmod**.*
In which case, *fmod* is a "function that does modulo on 2 floating-point
arguments".
I propose for a floating-point modulus operator as it's behavior has
already been defined in *fmod *as such.
Why is there a "function that does modulo on 2 floating-point arguments"
but no "operator that does modulo on 2 floating-point operands"?
What's more? Other languages (like c#) have their own % float operator,
having the *exact* same behavior as *fmod* from what I've read: *"The
returned value has the same sign as the numerator and is less than
denominator in magnitude"*. I had to highlight the word *exact* because it
is not surprising.
Sorry for the deleted posts.
I was not thinking clearly.
On Tuesday, April 24, 2018 at 3:07:12 PM UTC+8, ryan...@digipen.edu wrote:
>
> I think that it is discriminatory that integers have modulus operators
> but floats do not.
> It is unacceptable, and that is my opinion.
>
> I propose we add the modulus operator to floating point types.
>
--
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 email 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/7db24788-d433-4c19-839b-c1e9b2d2a98c%40isocpp.org.
------=_Part_29374_389105236.1524582746489
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div>I presume that=C2=A0<b>f</b>=C2=A0is floating-point, =
and <b>mod</b> is modulo, in std::<b>fmod</b><b>.</b></div><div>In which ca=
se, <b>fmod</b> is a "function that does modulo on 2 floating-point ar=
guments".</div><div>I propose for a floating-point modulus operator as=
it's behavior has already been defined in <b>fmod </b>as such.</div><d=
iv>Why is there a "function that does modulo on 2 floating-point argum=
ents" but no "operator that does modulo on 2 floating-point opera=
nds"?</div><div>What's more? Other languages (like c#) have their =
own % float operator, having the <u>exact</u> same behavior as <b>fmod</b>=
=C2=A0from what I've read:=C2=A0<i>"The returned value has the sam=
e sign as the numerator and is less than denominator in magnitude"</i>=
.. I had to highlight the word <u>exact</u> because it is not surprising.</d=
iv><div><br></div><div>Sorry for the deleted posts.</div><div>I was not thi=
nking clearly.<br><div><div><div><br><div>On Tuesday, April 24, 2018 at 3:0=
7:12 PM UTC+8, ryan...@digipen.edu wrote:<blockquote class=3D"gmail_quote" =
style=3D"margin: 0px 0px 0px 0.8ex; border-left: 1px solid rgb(204, 204, 20=
4); padding-left: 1ex;"><div dir=3D"ltr">I<span style=3D"color: rgb(29, 33,=
41); font-family: Helvetica, Arial, sans-serif; font-size: 14px;">=C2=A0th=
ink that it is discriminatory that integers have modulus operators but floa=
ts do not.</span><div><span style=3D"color: rgb(29, 33, 41); font-family: H=
elvetica, Arial, sans-serif; font-size: 14px;">It is unacceptable, and that=
is my opinion.</span></div><div><span style=3D"color: rgb(29, 33, 41); fon=
t-family: Helvetica, Arial, sans-serif; font-size: 14px;"><br></span></div>=
<div><span style=3D"color: rgb(29, 33, 41); font-family: Helvetica, Arial, =
sans-serif; font-size: 14px;">I propose we add the modulus operator to floa=
ting point types.</span></div></div></blockquote></div></div></div></div></=
div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/7db24788-d433-4c19-839b-c1e9b2d2a98c%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/7db24788-d433-4c19-839b-c1e9b2d2a98c=
%40isocpp.org</a>.<br />
------=_Part_29374_389105236.1524582746489--
------=_Part_29373_158374882.1524582746489--
.
Author: Thiago Macieira <thiago@macieira.org>
Date: Tue, 24 Apr 2018 09:04:48 -0700
Raw View
On Tuesday, 24 April 2018 08:12:26 PDT ryan.ang@digipen.edu wrote:
> Sorry for the deleted posts.
There's no such thing as deleted posts. Once you post, it's out here forever
and cannot be deleted.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
--
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 email 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/1613054.P9Hor4day4%40tjmaciei-mobl1.
.
Author: John McFarlane <john@mcfarlane.name>
Date: Tue, 24 Apr 2018 16:26:48 +0000
Raw View
--001a1145c8f8a11d42056a9a9f8c
Content-Type: text/plain; charset="UTF-8"
On Tue, Apr 24, 2018 at 8:12 AM <ryan.ang@digipen.edu> wrote:
> I presume that *f* is floating-point, and *mod* is modulo, in std::*fmod*
> *.*
> In which case, *fmod* is a "function that does modulo on 2 floating-point
> arguments".
> I propose for a floating-point modulus operator as it's behavior has
> already been defined in *fmod *as such.
> Why is there a "function that does modulo on 2 floating-point arguments"
> but no "operator that does modulo on 2 floating-point operands"?
>
The short answer is going to be "because that's how C does it". If
floating-point % never got added, it is likely because there is not enough
demand. The cost of adding a new language feature would be considerable and
the benefits would be minimal. Adding a function to the standard library is
far easier and in this case, it serves much the same purpose (constexpr
issues aside). As well as existing in C, integer % is far more desirable
because integer / is further from the 'real' quotient (on average and for
typical ranges) .
Also, integer / and % are in a sense complementary. You are asking for a %
which does not complement its equivalent /. (In Python there is // which
might be said to perform such a role.)
What's more? Other languages (like c#) have their own % float operator,
> having the *exact* same behavior as *fmod* from what I've read: *"The
> returned value has the same sign as the numerator and is less than
> denominator in magnitude"*. I had to highlight the word *exact* because
> it is not surprising.
>
I was surprised to read that C# has this. Then briefly surprised by the
search results when I looked for confirmation. Top results seem to be SO
questions by people who are confused by the results of % when used in
conjunction with decimal fractions.
John
> Sorry for the deleted posts.
> I was not thinking clearly.
>
>
> On Tuesday, April 24, 2018 at 3:07:12 PM UTC+8, ryan...@digipen.edu wrote:
>>
>> I think that it is discriminatory that integers have modulus operators
>> but floats do not.
>> It is unacceptable, and that is my opinion.
>>
>> I propose we add the modulus operator to floating point types.
>>
> --
> 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
> email 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/7db24788-d433-4c19-839b-c1e9b2d2a98c%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/7db24788-d433-4c19-839b-c1e9b2d2a98c%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
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 email 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/CABPJVnSuyiwJQ2CwhftjNHaeo-dqdi4rEWRpmcbvvUDcHi_Abw%40mail.gmail.com.
--001a1145c8f8a11d42056a9a9f8c
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">On Tue, Apr 24=
, 2018 at 8:12 AM <<a href=3D"mailto:ryan.ang@digipen.edu" target=3D"_bl=
ank">ryan.ang@digipen.edu</a>> wrote:<br></div><blockquote class=3D"gmai=
l_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left=
:1ex"><div dir=3D"ltr"><div>I presume that=C2=A0<b>f</b>=C2=A0is floating-p=
oint, and <b>mod</b> is modulo, in std::<b>fmod</b><b>.</b></div><div>In wh=
ich case, <b>fmod</b> is a "function that does modulo on 2 floating-po=
int arguments".</div><div>I propose for a floating-point modulus opera=
tor as it's behavior has already been defined in <b>fmod </b>as such.</=
div><div>Why is there a "function that does modulo on 2 floating-point=
arguments" but no "operator that does modulo on 2 floating-point=
operands"?</div></div></blockquote><div><br></div><div>The short answ=
er is going to be "because that's how C does it". If floating=
-point % never got added, it is likely because there is not enough demand. =
The cost of adding a new language feature would be considerable and the ben=
efits would be minimal. Adding a function to the standard library is far ea=
sier and in this case, it serves much the same purpose (constexpr issues as=
ide). As well as existing in C, integer % is far more desirable because int=
eger / is further from the 'real' quotient (on average and for typi=
cal ranges)
.. <br><br>Also, integer / and % are in a sense complementary. You are askin=
g for a % which does not complement its equivalent /. (In Python there is /=
/ which might be said to perform such a role.)<br><br></div><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa=
dding-left:1ex"><div dir=3D"ltr"><div>What's more? Other languages (lik=
e c#) have their own % float operator, having the <u>exact</u> same behavio=
r as <b>fmod</b>=C2=A0from what I've read:=C2=A0<i>"The returned v=
alue has the same sign as the numerator and is less than denominator in mag=
nitude"</i>. I had to highlight the word <u>exact</u> because it is no=
t surprising.</div></div></blockquote><div><br></div></div><div dir=3D"ltr"=
><div class=3D"gmail_quote"><div>I was surprised to read that C# has this. =
Then briefly surprised by the search results when I looked for confirmation=
.. Top results seem to be SO questions by people who are confused by the res=
ults of % when used in conjunction with decimal fractions. <br></div></div>=
</div><div dir=3D"ltr"><div class=3D"gmail_quote"><div><br></div><div>John<=
br><br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;b=
order-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><br></div=
><div>Sorry for the deleted posts.</div><div>I was not thinking clearly.</d=
iv></div><div dir=3D"ltr"><div><br><div><div><div><br><div>On Tuesday, Apri=
l 24, 2018 at 3:07:12 PM UTC+8, <a href=3D"mailto:ryan...@digipen.edu" targ=
et=3D"_blank">ryan...@digipen.edu</a> wrote:<blockquote class=3D"gmail_quot=
e" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204)=
;padding-left:1ex"><div dir=3D"ltr">I<span style=3D"color:rgb(29,33,41);fon=
t-family:Helvetica,Arial,sans-serif;font-size:14px">=C2=A0think that it is =
discriminatory that integers have modulus operators but floats do not.</spa=
n><div><span style=3D"color:rgb(29,33,41);font-family:Helvetica,Arial,sans-=
serif;font-size:14px">It is unacceptable, and that is my opinion.</span></d=
iv><div><span style=3D"color:rgb(29,33,41);font-family:Helvetica,Arial,sans=
-serif;font-size:14px"><br></span></div><div><span style=3D"color:rgb(29,33=
,41);font-family:Helvetica,Arial,sans-serif;font-size:14px">I propose we ad=
d the modulus operator to floating point types.</span></div></div></blockqu=
ote></div></div></div></div></div></div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/7db24788-d433-4c19-839b-c1e9b2d2a98c%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/7db24788-d433-=
4c19-839b-c1e9b2d2a98c%40isocpp.org</a>.<br>
</blockquote></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CABPJVnSuyiwJQ2CwhftjNHaeo-dqdi4rEWRp=
mcbvvUDcHi_Abw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CABPJVnSuyiwJQ2Cw=
hftjNHaeo-dqdi4rEWRpmcbvvUDcHi_Abw%40mail.gmail.com</a>.<br />
--001a1145c8f8a11d42056a9a9f8c--
.
Author: Hyman Rosen <hyman.rosen@gmail.com>
Date: Tue, 24 Apr 2018 13:45:16 -0400
Raw View
--000000000000d15d4f056a9bb8cc
Content-Type: text/plain; charset="UTF-8"
On Tue, Apr 24, 2018 at 3:47 AM, <ryan.ang@digipen.edu> wrote:
> constexpr float f = 13.f % 2.1f; // f == 0.4
> constexpr float f = std::fmod(13.f, 2.1f); // not compilable
>
Actually, if we were to have a % operator for float, the result of 13.f %
2.1%f would be
0.40000057220458984375 (given IEEE binary floating point), and would lead
to whining,
whinging, and unhappiness.
That's because the thing that you write as 2.1f is, in fact,
2.099999904632568359375,
and the remainder when six of those are subtracted from thirteen is the
value above.
Note that this value is not the value of the thing you write as 0.4f, which
is
0.4000000059604644775390625.
It's a different story with decimal floating-point, of course.
--
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 email 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/CAHSYqdYZansA3WY%3Dx-t9aUtUNwoiURpqGyKJ%2Bq%2BzRJK9Wg7DxA%40mail.gmail.com.
--000000000000d15d4f056a9bb8cc
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On T=
ue, Apr 24, 2018 at 3:47 AM, <span dir=3D"ltr"><<a href=3D"mailto:ryan.=
ang@digipen.edu" target=3D"_blank">ryan.ang@digipen.edu</a>></span> wrot=
e:<br><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;b=
order-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><d=
iv class=3D"gmail-m_-2218637933361713400prettyprint" style=3D"background-co=
lor:rgb(250,250,250);border-color:rgb(187,187,187);border-style:solid;borde=
r-width:1px;word-wrap:break-word"><code class=3D"gmail-m_-22186379333617134=
00prettyprint"><div class=3D"gmail-m_-2218637933361713400subprettyprint"><s=
pan style=3D"color:rgb(0,0,136)" class=3D"gmail-m_-2218637933361713400style=
d-by-prettify">constexpr</span><span style=3D"color:rgb(0,0,0)" class=3D"gm=
ail-m_-2218637933361713400styled-by-prettify"> </span><span style=3D"color:=
rgb(0,0,136)" class=3D"gmail-m_-2218637933361713400styled-by-prettify">floa=
t</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-2218637933361713=
400styled-by-prettify"> f </span><span style=3D"color:rgb(102,102,0)" class=
=3D"gmail-m_-2218637933361713400styled-by-prettify">=3D</span><span style=
=3D"color:rgb(0,0,0)" class=3D"gmail-m_-2218637933361713400styled-by-pretti=
fy"> </span><span style=3D"color:rgb(0,102,102)" class=3D"gmail-m_-22186379=
33361713400styled-by-prettify">13.f</span><span style=3D"color:rgb(0,0,0)" =
class=3D"gmail-m_-2218637933361713400styled-by-prettify"> </span><span styl=
e=3D"color:rgb(102,102,0)" class=3D"gmail-m_-2218637933361713400styled-by-p=
rettify">%</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-2218637=
933361713400styled-by-prettify"> </span><span style=3D"color:rgb(0,102,102)=
" class=3D"gmail-m_-2218637933361713400styled-by-prettify">2.1f</span><span=
style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-2218637933361713400styled=
-by-prettify">;</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-22=
18637933361713400styled-by-prettify"> </span><span style=3D"color:rgb(136,0=
,0)" class=3D"gmail-m_-2218637933361713400styled-by-prettify">// f =3D=3D 0=
..4</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-221863793336171=
3400styled-by-prettify"><br></span><span style=3D"color:rgb(0,0,136)" class=
=3D"gmail-m_-2218637933361713400styled-by-prettify">constexpr</span><span s=
tyle=3D"color:rgb(0,0,0)" class=3D"gmail-m_-2218637933361713400styled-by-pr=
ettify"> </span><span style=3D"color:rgb(0,0,136)" class=3D"gmail-m_-221863=
7933361713400styled-by-prettify">float</span><span style=3D"color:rgb(0,0,0=
)" class=3D"gmail-m_-2218637933361713400styled-by-prettify"> f </span><span=
style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-2218637933361713400styled=
-by-prettify">=3D</span><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-=
2218637933361713400styled-by-prettify"> std</span><span style=3D"color:rgb(=
102,102,0)" class=3D"gmail-m_-2218637933361713400styled-by-prettify">::</sp=
an><span style=3D"color:rgb(0,0,0)" class=3D"gmail-m_-2218637933361713400st=
yled-by-prettify">fmod</span><span style=3D"color:rgb(102,102,0)" class=3D"=
gmail-m_-2218637933361713400styled-by-prettify">(</span><span style=3D"colo=
r:rgb(0,102,102)" class=3D"gmail-m_-2218637933361713400styled-by-prettify">=
13.f</span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-221863793=
3361713400styled-by-prettify">,</span><span style=3D"color:rgb(0,0,0)" clas=
s=3D"gmail-m_-2218637933361713400styled-by-prettify"> </span><span style=3D=
"color:rgb(0,102,102)" class=3D"gmail-m_-2218637933361713400styled-by-prett=
ify">2.1f</span><span style=3D"color:rgb(102,102,0)" class=3D"gmail-m_-2218=
637933361713400styled-by-prettify">);</span><span style=3D"color:rgb(0,0,0)=
" class=3D"gmail-m_-2218637933361713400styled-by-prettify"> </span><span st=
yle=3D"color:rgb(136,0,0)" class=3D"gmail-m_-2218637933361713400styled-by-p=
rettify">// not compilable</span></div></code></div></div></blockquote><div=
><br></div><div>Actually, if we were to have a <font face=3D"monospace, mon=
ospace">%</font> operator for float, the result of <font face=3D"monospace,=
monospace">13.f % 2.1%f=C2=A0</font>would be<br>=C2=A0<font face=3D"monosp=
ace, monospace">0.40000057220458984375</font> (given IEEE binary floating p=
oint), and would lead to whining,<br>whinging, and unhappiness.<br><br>That=
's because the thing that you write as <font face=3D"monospace, monospa=
ce">2.1f</font> is, in fact, <font face=3D"monospace, monospace">2.09999990=
4632568359375</font>,<br><font face=3D"arial, helvetica, sans-serif">and th=
e remainder when six of those are subtracted from thirteen is the value abo=
ve.<br>Note that this value is not the value of the thing you write as </fo=
nt><font face=3D"monospace, monospace">0.4f, which is<br>0.4000000059604644=
775390625</font><font face=3D"arial, helvetica, sans-serif">.<br><br>It'=
;s a different story with decimal floating-point, of course.</font></div></=
div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAHSYqdYZansA3WY%3Dx-t9aUtUNwoiURpqGy=
KJ%2Bq%2BzRJK9Wg7DxA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdYZan=
sA3WY%3Dx-t9aUtUNwoiURpqGyKJ%2Bq%2BzRJK9Wg7DxA%40mail.gmail.com</a>.<br />
--000000000000d15d4f056a9bb8cc--
.
Author: Bo Persson <bop@gmb.dk>
Date: Tue, 24 Apr 2018 20:36:35 +0200
Raw View
On 2018-04-24 17:12, ryan.ang@digipen.edu wrote:
> I presume that *f*=C2=A0is floating-point, and *mod* is modulo, in std::*=
fmod**.*
> In which case, *fmod* is a "function that does modulo on 2=20
> floating-point arguments".
> I propose for a floating-point modulus operator as it's behavior has=20
> already been defined in *fmod *as such.
Changing the language to get another way of doing something that can=20
already be done in a reasonable wya is likely very low priority for the=20
committee.
It's not like using % is extremely more convenient and going to be=20
useful to a wide audience.
Bo Persson
--=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/pbntbh%24olf%241%40blaine.gmane.org.
.
Author: Jakob Riedle <jakob.riedle@gmail.com>
Date: Wed, 25 Apr 2018 09:31:28 -0700 (PDT)
Raw View
------=_Part_33385_1992977550.1524673888298
Content-Type: multipart/alternative;
boundary="----=_Part_33386_839072109.1524673888298"
------=_Part_33386_839072109.1524673888298
Content-Type: text/plain; charset="UTF-8"
Am Dienstag, 24. April 2018 11:43:44 UTC+2 schrieb John McFarlane:
>
> The remainder can be thought of as the value that is lost as a result of
> rounding down of the quotient. The rounding occurs because integers have a
> fixed resolution of 1. Floats do not.
>
> For integer division, if n/d=q and n%d=r then if follows that q*d+r=n. So
> having a remainder of 0.4f in your example only makes sense if 13.f / 2.1f
> == 6 and that would change the behavior of floating-point division.
>
I disagree at this point. I agree that the intermediate division result is
not used as a floating point value but casted to a whole number instead
(which is not consistent, but very intuitive, since the operation would
have no meaning otherwise as you already prescribed).
However, you can always find a system of reasoning that justifies a
language inconsistency with regards to the desires of language users.
The modulo operation clearly has only one intuitive behaviour (excluded
signed operands) which additionally has a significant amount of users that
would benefit from such a change, regardles of whether the committee
prioritises that way.
I am in favor of this change. +1
Jakob
--
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 email 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/a2825d04-5d39-4ce1-bcf3-f20db6fcd430%40isocpp.org.
------=_Part_33386_839072109.1524673888298
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr">Am Dienstag, 24. April 2018 11:43:44 UTC+2 schrieb John Mc=
Farlane:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-left: 0=
..8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"ltr"><div>=
The remainder can be thought of as the value that is lost as a result of ro=
unding down of the quotient.=20
The rounding occurs because integers have a fixed resolution of 1. Floats d=
o not.<br></div><div><br></div><div>For integer division, if n/d=3Dq
and n%d=3Dr then if follows that q*d+r=3Dn.=20
So having a remainder of 0.4f in your example only makes sense if 13.f / 2.=
1f =3D=3D 6 and that would change the behavior of floating-point division.<=
/div></div></blockquote><div><br></div><div>I disagree at this point. I agr=
ee that the intermediate division result is not used as a floating point va=
lue but casted to a whole number instead (which is not consistent, but very=
intuitive, since the operation would have no meaning otherwise as you alre=
ady prescribed).</div><div>However, you can always find a system of reasoni=
ng that justifies a language inconsistency with regards to the desires of l=
anguage users.<br></div><div>The modulo operation clearly has only one intu=
itive behaviour (excluded signed operands) which additionally has a signifi=
cant amount of users that would benefit from such a change, regardles of wh=
ether the committee prioritises that way.</div><div><br></div><div>I am in =
favor of this change. +1</div><div><br></div><div>Jakob</div><div><br></div=
><div><br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/a2825d04-5d39-4ce1-bcf3-f20db6fcd430%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/a2825d04-5d39-4ce1-bcf3-f20db6fcd430=
%40isocpp.org</a>.<br />
------=_Part_33386_839072109.1524673888298--
------=_Part_33385_1992977550.1524673888298--
.
Author: Jake Arkinstall <jake.arkinstall@gmail.com>
Date: Wed, 25 Apr 2018 16:57:09 +0000
Raw View
--000000000000fd4805056aaf29dc
Content-Type: text/plain; charset="UTF-8"
I'm also in favour of the change. We can talk about the uses of it and the
pitfalls of floating representation until the cows come home, but that
doesnt change that there are uses (justifying the existence of fmodf in the
first place), that it is already deemed useful enough to be effortlessly
implemented in a variety of other languages, and that the "different code
for different types" ethos is not the C++ way.
Whether or not I believe that the change is feasible is another matter. I
can only see three reasonable approaches. The first is to get the C
community on board. Failing that, we could figure out a way of allowing
operator functions on primitives without demolishing the language. Failing
that, we could standardise a wrapping class around certain primitives that
allows us to embellish them without the negotiations required for the
previous two approaches.
These are in descending order of usefulness but ascending order of ease.
On Wed, 25 Apr 2018, 17:31 Jakob Riedle, <jakob.riedle@gmail.com> wrote:
> Am Dienstag, 24. April 2018 11:43:44 UTC+2 schrieb John McFarlane:
>>
>> The remainder can be thought of as the value that is lost as a result of
>> rounding down of the quotient. The rounding occurs because integers have a
>> fixed resolution of 1. Floats do not.
>>
>> For integer division, if n/d=q and n%d=r then if follows that q*d+r=n. So
>> having a remainder of 0.4f in your example only makes sense if 13.f / 2.1f
>> == 6 and that would change the behavior of floating-point division.
>>
>
> I disagree at this point. I agree that the intermediate division result is
> not used as a floating point value but casted to a whole number instead
> (which is not consistent, but very intuitive, since the operation would
> have no meaning otherwise as you already prescribed).
> However, you can always find a system of reasoning that justifies a
> language inconsistency with regards to the desires of language users.
> The modulo operation clearly has only one intuitive behaviour (excluded
> signed operands) which additionally has a significant amount of users that
> would benefit from such a change, regardles of whether the committee
> prioritises that way.
>
> I am in favor of this change. +1
>
> Jakob
>
>
> --
> 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
> email 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/a2825d04-5d39-4ce1-bcf3-f20db6fcd430%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/a2825d04-5d39-4ce1-bcf3-f20db6fcd430%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
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 email 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/CAC%2B0CCN3Y6wP97dPNm4KvMVBa2zHAR-YAxS%2B-%2BoP-jzO-JfV1w%40mail.gmail.com.
--000000000000fd4805056aaf29dc
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"auto">I'm also in favour of the change. We can talk about t=
he uses of it and the pitfalls of floating representation until the cows co=
me home, but that doesnt change that there are uses (justifying the existen=
ce of fmodf in the first place), that it is already deemed useful enough to=
be effortlessly implemented in a variety of other languages, and that the =
"different code for different types" ethos is not the C++ way.<di=
v dir=3D"auto"><br></div><div dir=3D"auto">Whether or not I believe that th=
e change is feasible is another matter. I can only see three reasonable app=
roaches. The first is to get the C community on board. Failing that, we cou=
ld figure out a way of allowing operator functions on primitives without de=
molishing the language. Failing that, we could standardise a wrapping class=
around certain primitives that allows us to embellish them without the neg=
otiations required for the previous two approaches.</div><div dir=3D"auto">=
<br></div><div dir=3D"auto">These are in descending order of usefulness but=
ascending order of ease.=C2=A0</div></div><br><div class=3D"gmail_quote"><=
div dir=3D"ltr">On Wed, 25 Apr 2018, 17:31 Jakob Riedle, <<a href=3D"mai=
lto:jakob.riedle@gmail.com">jakob.riedle@gmail.com</a>> wrote:<br></div>=
<blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p=
x #ccc solid;padding-left:1ex"><div dir=3D"ltr">Am Dienstag, 24. April 2018=
11:43:44 UTC+2 schrieb John McFarlane:<blockquote class=3D"gmail_quote" st=
yle=3D"margin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1=
ex"><div dir=3D"ltr"><div>The remainder can be thought of as the value that=
is lost as a result of rounding down of the quotient.=20
The rounding occurs because integers have a fixed resolution of 1. Floats d=
o not.<br></div><div><br></div><div>For integer division, if n/d=3Dq
and n%d=3Dr then if follows that q*d+r=3Dn.=20
So having a remainder of 0.4f in your example only makes sense if 13.f / 2.=
1f =3D=3D 6 and that would change the behavior of floating-point division.<=
/div></div></blockquote><div><br></div><div>I disagree at this point. I agr=
ee that the intermediate division result is not used as a floating point va=
lue but casted to a whole number instead (which is not consistent, but very=
intuitive, since the operation would have no meaning otherwise as you alre=
ady prescribed).</div><div>However, you can always find a system of reasoni=
ng that justifies a language inconsistency with regards to the desires of l=
anguage users.<br></div><div>The modulo operation clearly has only one intu=
itive behaviour (excluded signed operands) which additionally has a signifi=
cant amount of users that would benefit from such a change, regardles of wh=
ether the committee prioritises that way.</div><div><br></div><div>I am in =
favor of this change. +1</div><div><br></div><div>Jakob</div><div><br></div=
><div><br></div></div>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank" rel=3D"noreferrer">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank" rel=3D"noreferrer">std-proposals@isocpp.org</a>.<br=
>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/a2825d04-5d39-4ce1-bcf3-f20db6fcd430%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank" =
rel=3D"noreferrer">https://groups.google.com/a/isocpp.org/d/msgid/std-propo=
sals/a2825d04-5d39-4ce1-bcf3-f20db6fcd430%40isocpp.org</a>.<br>
</blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCN3Y6wP97dPNm4KvMVBa2zHAR-YAx=
S%2B-%2BoP-jzO-JfV1w%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCN3=
Y6wP97dPNm4KvMVBa2zHAR-YAxS%2B-%2BoP-jzO-JfV1w%40mail.gmail.com</a>.<br />
--000000000000fd4805056aaf29dc--
.
Author: Hyman Rosen <hyman.rosen@gmail.com>
Date: Wed, 25 Apr 2018 13:09:31 -0400
Raw View
--001a1141ec7ed0596d056aaf56ea
Content-Type: text/plain; charset="UTF-8"
On Wed, Apr 25, 2018 at 12:31 PM, Jakob Riedle <jakob.riedle@gmail.com>
wrote:
>
> The modulo operation clearly has only one intuitive behaviour
>
As I said before, if floating-point % existed, then 13.0f % 2.6f would
result in
0.40000057220458984375f exactly. The values written as 0.40000056f,
0.40000057f, and 0.40000058f all convert to that value, but the value
written
as 0.4f does not, being exactly equal to 0.4000000059604644775390625f.
This is not at all intuitive, even before you get to compiler permission to
keep
expression results in extended precision. Making an operator that fools
people
is going to make them unhappy.
--
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 email 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/CAHSYqdYqC%2B8DaUztkkDR%3DEapRL-Uq_MKjB1wmyFBiZTQz2Wt3Q%40mail.gmail.com.
--001a1141ec7ed0596d056aaf56ea
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On W=
ed, Apr 25, 2018 at 12:31 PM, Jakob Riedle <span dir=3D"ltr"><<a href=3D=
"mailto:jakob.riedle@gmail.com" target=3D"_blank">jakob.riedle@gmail.com</a=
>></span> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0px 0p=
x 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div d=
ir=3D"ltr"><div>The modulo operation clearly has only one intuitive behavio=
ur</div></div></blockquote><div><br>As I said before, if floating-point % e=
xisted, then 13.0f % 2.6f would result in<br>
<span style=3D"color:rgb(34,34,34);font-family:monospace,monospace;font-siz=
e:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:=
normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0=
px;text-transform:none;white-space:normal;word-spacing:0px;background-color=
:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initi=
al;float:none;display:inline">0.40000057220458984375f</span><span style=3D"=
color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatur=
es:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;te=
xt-align:start;text-indent:0px;text-transform:none;white-space:normal;word-=
spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial=
;text-decoration-color:initial;float:none;display:inline"><font face=3D"ari=
al, helvetica, sans-serif"> exactly.=C2=A0 The values written as=C2=A0</fon=
t></span><span style=3D"font-size:12.8px"><font face=3D"monospace, monospac=
e">0.40000056f</font><font face=3D"arial, helvetica, sans-serif">,</font><b=
r></span><font face=3D"monospace, monospace">0.40000057f</font>, and=C2=A0<=
font face=3D"monospace, monospace">0.40000058f</font> all convert to that v=
alue, but the value written<br>as <font face=3D"monospace, monospace">0.4f<=
/font> does not, being exactly equal to <font face=3D"monospace, monospace"=
>0.4000000059604644775390625f</font>.<br><br>This is not at all intuitive, =
even before you get to compiler permission to keep<br>expression results in=
extended precision.=C2=A0 Making an operator that fools people<br>is going=
to make them unhappy.</div></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAHSYqdYqC%2B8DaUztkkDR%3DEapRL-Uq_MK=
jB1wmyFBiZTQz2Wt3Q%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdYqC%2B=
8DaUztkkDR%3DEapRL-Uq_MKjB1wmyFBiZTQz2Wt3Q%40mail.gmail.com</a>.<br />
--001a1141ec7ed0596d056aaf56ea--
.
Author: Jake Arkinstall <jake.arkinstall@gmail.com>
Date: Wed, 25 Apr 2018 17:17:24 +0000
Raw View
--0000000000006565be056aaf72b3
Content-Type: text/plain; charset="UTF-8"
On Wed, 25 Apr 2018, 18:09 Hyman Rosen, <hyman.rosen@gmail.com> wrote:
> On Wed, Apr 25, 2018 at 12:31 PM, Jakob Riedle <jakob.riedle@gmail.com>
> wrote:
>>
>> The modulo operation clearly has only one intuitive behaviour
>>
>
> As I said before, if floating-point % existed, then 13.0f % 2.6f would
> result in
> 0.40000057220458984375f exactly. The values written as 0.40000056f,
> 0.40000057f, and 0.40000058f all convert to that value, but the value
> written
> as 0.4f does not, being exactly equal to 0.4000000059604644775390625f.
>
> This is not at all intuitive
>
It is intuitive to anyone who understands floating point arithmetic. The
same thing appears in a large number of common float operations - I don't
see how this is directly related to the post.
--
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 email 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/CAC%2B0CCNs5F30p%2Bn_HcvYqXGQ%2BML%3DoQL5aYXeBn5%3DLXhdJ_1vEQ%40mail.gmail.com.
--0000000000006565be056aaf72b3
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"auto"><div><div class=3D"gmail_quote"><div dir=3D"ltr">On Wed, =
25 Apr 2018, 18:09 Hyman Rosen, <<a href=3D"mailto:hyman.rosen@gmail.com=
">hyman.rosen@gmail.com</a>> wrote:<br></div><blockquote class=3D"gmail_=
quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1=
ex"><div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">=
On Wed, Apr 25, 2018 at 12:31 PM, Jakob Riedle <span dir=3D"ltr"><<a hre=
f=3D"mailto:jakob.riedle@gmail.com" target=3D"_blank" rel=3D"noreferrer">ja=
kob.riedle@gmail.com</a>></span> wrote:<blockquote class=3D"gmail_quote"=
style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);p=
adding-left:1ex"><div dir=3D"ltr"><div>The modulo operation clearly has onl=
y one intuitive behaviour</div></div></blockquote><div><br>As I said before=
, if floating-point % existed, then 13.0f % 2.6f would result in<br>
<span style=3D"color:rgb(34,34,34);font-family:monospace,monospace;font-siz=
e:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:=
normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0=
px;text-transform:none;white-space:normal;word-spacing:0px;background-color=
:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initi=
al;float:none;display:inline">0.40000057220458984375f</span><span style=3D"=
color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatur=
es:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;te=
xt-align:start;text-indent:0px;text-transform:none;white-space:normal;word-=
spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial=
;text-decoration-color:initial;float:none;display:inline"><font face=3D"ari=
al, helvetica, sans-serif"> exactly.=C2=A0 The values written as=C2=A0</fon=
t></span><span style=3D"font-size:12.8px"><font face=3D"monospace, monospac=
e">0.40000056f</font><font face=3D"arial, helvetica, sans-serif">,</font><b=
r></span><font face=3D"monospace, monospace">0.40000057f</font>, and=C2=A0<=
font face=3D"monospace, monospace">0.40000058f</font> all convert to that v=
alue, but the value written<br>as <font face=3D"monospace, monospace">0.4f<=
/font> does not, being exactly equal to <font face=3D"monospace, monospace"=
>0.4000000059604644775390625f</font>.<br><br>This is not at all intuitive</=
div></div></div></div></blockquote></div></div><div dir=3D"auto"><br></div>=
<div dir=3D"auto">It is intuitive to anyone who understands floating point =
arithmetic. The same thing appears in a large number of common float operat=
ions - I don't see how this is directly related to the post.</div></div=
>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCNs5F30p%2Bn_HcvYqXGQ%2BML%3D=
oQL5aYXeBn5%3DLXhdJ_1vEQ%40mail.gmail.com?utm_medium=3Demail&utm_source=3Df=
ooter">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0=
CCNs5F30p%2Bn_HcvYqXGQ%2BML%3DoQL5aYXeBn5%3DLXhdJ_1vEQ%40mail.gmail.com</a>=
..<br />
--0000000000006565be056aaf72b3--
.
Author: Tony V E <tvaneerd@gmail.com>
Date: Wed, 25 Apr 2018 13:23:44 -0400
Raw View
--00000000000082f3c8056aaf884d
Content-Type: text/plain; charset="UTF-8"
On Wed, Apr 25, 2018 at 1:09 PM, Hyman Rosen <hyman.rosen@gmail.com> wrote:
> On Wed, Apr 25, 2018 at 12:31 PM, Jakob Riedle <jakob.riedle@gmail.com>
> wrote:
>>
>> The modulo operation clearly has only one intuitive behaviour
>>
>
> As I said before, if floating-point % existed, then 13.0f % 2.6f would
> result in
> 0.40000057220458984375f exactly. The values written as 0.40000056f,
> 0.40000057f, and 0.40000058f all convert to that value, but the value
> written
> as 0.4f does not, being exactly equal to 0.4000000059604644775390625f.
>
> This is not at all intuitive, even before you get to compiler permission
> to keep
> expression results in extended precision. Making an operator that fools
> people
> is going to make them unhappy.
>
Does fmod() currently have these same issues?
--
Be seeing you,
Tony
--
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 email 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/CAOHCbiu%2BXaLnAtvosSL%2BSjRB%2Bck9h_6_1MKFEVKSUyq-CynnFw%40mail.gmail.com.
--00000000000082f3c8056aaf884d
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Wed, Apr 25, 2018 at 1:09 PM, Hyman Rosen <span dir=3D"ltr"><<a h=
ref=3D"mailto:hyman.rosen@gmail.com" target=3D"_blank">hyman.rosen@gmail.co=
m</a>></span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"margi=
n:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr">=
<div class=3D"gmail_extra"><div class=3D"gmail_quote"><span class=3D"">On W=
ed, Apr 25, 2018 at 12:31 PM, Jakob Riedle <span dir=3D"ltr"><<a href=3D=
"mailto:jakob.riedle@gmail.com" target=3D"_blank">jakob.riedle@gmail.com</a=
>></span> wrote:<blockquote class=3D"gmail_quote" style=3D"margin:0px 0p=
x 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div d=
ir=3D"ltr"><div>The modulo operation clearly has only one intuitive behavio=
ur</div></div></blockquote></span><div><br>As I said before, if floating-po=
int % existed, then 13.0f % 2.6f would result in<br>
<span style=3D"color:rgb(34,34,34);font-family:monospace,monospace;font-siz=
e:12.8px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:=
normal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0=
px;text-transform:none;white-space:normal;word-spacing:0px;background-color=
:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initi=
al;float:none;display:inline">0.40000057220458984375f</span><span style=3D"=
color:rgb(34,34,34);font-size:12.8px;font-style:normal;font-variant-ligatur=
es:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;te=
xt-align:start;text-indent:0px;text-transform:none;white-space:normal;word-=
spacing:0px;background-color:rgb(255,255,255);text-decoration-style:initial=
;text-decoration-color:initial;float:none;display:inline"><font face=3D"ari=
al, helvetica, sans-serif"> exactly.=C2=A0 The values written as=C2=A0</fon=
t></span><span style=3D"font-size:12.8px"><font face=3D"monospace, monospac=
e">0.40000056f</font><font face=3D"arial, helvetica, sans-serif">,</font><b=
r></span><font face=3D"monospace, monospace">0.40000057f</font>, and=C2=A0<=
font face=3D"monospace, monospace">0.40000058f</font> all convert to that v=
alue, but the value written<br>as <font face=3D"monospace, monospace">0.4f<=
/font> does not, being exactly equal to <font face=3D"monospace, monospace"=
>0.4000000059604644775390625f</font>.<br><br>This is not at all intuitive, =
even before you get to compiler permission to keep<br>expression results in=
extended precision.=C2=A0 Making an operator that fools people<br>is going=
to make them unhappy.</div></div></div></div></blockquote><div><br></div><=
div><br>Does fmod() currently have these same issues?<br><br></div></div>--=
<br><div class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div=
dir=3D"ltr"><div>Be seeing you,<br></div>Tony<br></div></div>
</div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAOHCbiu%2BXaLnAtvosSL%2BSjRB%2Bck9h_=
6_1MKFEVKSUyq-CynnFw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAOHCbiu%2B=
XaLnAtvosSL%2BSjRB%2Bck9h_6_1MKFEVKSUyq-CynnFw%40mail.gmail.com</a>.<br />
--00000000000082f3c8056aaf884d--
.
Author: Hyman Rosen <hyman.rosen@gmail.com>
Date: Wed, 25 Apr 2018 13:24:14 -0400
Raw View
--001a114446fa7222c7056aaf8ba5
Content-Type: text/plain; charset="UTF-8"
On Wed, Apr 25, 2018 at 1:17 PM, Jake Arkinstall <jake.arkinstall@gmail.com>
wrote:
>
> It is intuitive to anyone who understands floating point arithmetic.
>
No one understands floating-point arithmetic. (Actually, that number of
people is not exactly zero, but you're supposed to compare those numbers
using ranges, right? :-)
> The same thing appears in a large number of common float operations -
>
I don't see how this is directly related to the post.
>
The OP wrote constexpr float f = 13.f % 2.1f; // f == 0.4
Seems pretty related to me. They've asked for an operator,
given an example of its use, and described the result, a result
they would in fact not get if the operator were implemented.
--
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 email 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/CAHSYqdYNjp%2B9YmeOtzXRMJ8fDhhdcNETkaeLU%3D43Xm1UtqDWjw%40mail.gmail.com.
--001a114446fa7222c7056aaf8ba5
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On W=
ed, Apr 25, 2018 at 1:17 PM, Jake Arkinstall <span dir=3D"ltr"><<a href=
=3D"mailto:jake.arkinstall@gmail.com" target=3D"_blank">jake.arkinstall@gma=
il.com</a>></span> wrote:<blockquote class=3D"gmail_quote" style=3D"marg=
in:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"auto=
"><div dir=3D"auto">It is intuitive to anyone who understands floating poin=
t arithmetic.</div></div></blockquote><div><br>No one understands floating-=
point arithmetic.=C2=A0 (Actually, that number of<br>people is not exactly =
zero, but you're supposed to compare those numbers<br>using ranges, rig=
ht? :-)<br>=C2=A0</div><blockquote class=3D"gmail_quote" style=3D"margin:0 =
0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"auto"><di=
v dir=3D"auto">The same thing appears in a large number of common float ope=
rations -</div></div></blockquote><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"auto"><div dir=3D"auto">I don't see how this is directly related to=
the post.</div></div></blockquote><div><br>The OP wrote=C2=A0
<span class=3D"gmail-m_-6188734370832073816styled-by-prettify" style=3D"fon=
t-family:monospace;font-size:10.4px;font-style:normal;font-variant-ligature=
s:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;tex=
t-align:start;text-indent:0px;text-transform:none;white-space:normal;word-s=
pacing:0px;background-color:rgb(250,250,250);text-decoration-style:initial;=
text-decoration-color:initial;color:rgb(0,0,136)">constexpr</span><span cla=
ss=3D"gmail-m_-6188734370832073816styled-by-prettify" style=3D"font-family:=
monospace;font-size:10.4px;font-style:normal;font-variant-ligatures:normal;=
font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:s=
tart;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0p=
x;background-color:rgb(250,250,250);text-decoration-style:initial;text-deco=
ration-color:initial;color:rgb(0,0,0)"><span>=C2=A0</span></span><span clas=
s=3D"gmail-m_-6188734370832073816styled-by-prettify" style=3D"font-family:m=
onospace;font-size:10.4px;font-style:normal;font-variant-ligatures:normal;f=
ont-variant-caps:normal;font-weight:400;letter-spacing:normal;text-align:st=
art;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px=
;background-color:rgb(250,250,250);text-decoration-style:initial;text-decor=
ation-color:initial;color:rgb(0,0,136)">float</span><span class=3D"gmail-m_=
-6188734370832073816styled-by-prettify" style=3D"font-family:monospace;font=
-size:10.4px;font-style:normal;font-variant-ligatures:normal;font-variant-c=
aps:normal;font-weight:400;letter-spacing:normal;text-align:start;text-inde=
nt:0px;text-transform:none;white-space:normal;word-spacing:0px;background-c=
olor:rgb(250,250,250);text-decoration-style:initial;text-decoration-color:i=
nitial;color:rgb(0,0,0)"><span>=C2=A0</span>f<span>=C2=A0</span></span><spa=
n class=3D"gmail-m_-6188734370832073816styled-by-prettify" style=3D"font-fa=
mily:monospace;font-size:10.4px;font-style:normal;font-variant-ligatures:no=
rmal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;text-al=
ign:start;text-indent:0px;text-transform:none;white-space:normal;word-spaci=
ng:0px;background-color:rgb(250,250,250);text-decoration-style:initial;text=
-decoration-color:initial;color:rgb(102,102,0)">=3D</span><span class=3D"gm=
ail-m_-6188734370832073816styled-by-prettify" style=3D"font-family:monospac=
e;font-size:10.4px;font-style:normal;font-variant-ligatures:normal;font-var=
iant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;tex=
t-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;backgr=
ound-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-c=
olor:initial;color:rgb(0,0,0)"><span>=C2=A0</span></span><span class=3D"gma=
il-m_-6188734370832073816styled-by-prettify" style=3D"font-family:monospace=
;font-size:10.4px;font-style:normal;font-variant-ligatures:normal;font-vari=
ant-caps:normal;font-weight:400;letter-spacing:normal;text-align:start;text=
-indent:0px;text-transform:none;white-space:normal;word-spacing:0px;backgro=
und-color:rgb(250,250,250);text-decoration-style:initial;text-decoration-co=
lor:initial;color:rgb(0,102,102)">13.f</span><span class=3D"gmail-m_-618873=
4370832073816styled-by-prettify" style=3D"font-family:monospace;font-size:1=
0.4px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:nor=
mal;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;=
text-transform:none;white-space:normal;word-spacing:0px;background-color:rg=
b(250,250,250);text-decoration-style:initial;text-decoration-color:initial;=
color:rgb(0,0,0)"><span>=C2=A0</span></span><span class=3D"gmail-m_-6188734=
370832073816styled-by-prettify" style=3D"font-family:monospace;font-size:10=
..4px;font-style:normal;font-variant-ligatures:normal;font-variant-caps:norm=
al;font-weight:400;letter-spacing:normal;text-align:start;text-indent:0px;t=
ext-transform:none;white-space:normal;word-spacing:0px;background-color:rgb=
(250,250,250);text-decoration-style:initial;text-decoration-color:initial;c=
olor:rgb(102,102,0)">%</span><span class=3D"gmail-m_-6188734370832073816sty=
led-by-prettify" style=3D"font-family:monospace;font-size:10.4px;font-style=
:normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:=
400;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:n=
one;white-space:normal;word-spacing:0px;background-color:rgb(250,250,250);t=
ext-decoration-style:initial;text-decoration-color:initial;color:rgb(0,0,0)=
"><span>=C2=A0</span></span><span class=3D"gmail-m_-6188734370832073816styl=
ed-by-prettify" style=3D"font-family:monospace;font-size:10.4px;font-style:=
normal;font-variant-ligatures:normal;font-variant-caps:normal;font-weight:4=
00;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:no=
ne;white-space:normal;word-spacing:0px;background-color:rgb(250,250,250);te=
xt-decoration-style:initial;text-decoration-color:initial;color:rgb(0,102,1=
02)">2.1f</span><span class=3D"gmail-m_-6188734370832073816styled-by-pretti=
fy" style=3D"font-family:monospace;font-size:10.4px;font-style:normal;font-=
variant-ligatures:normal;font-variant-caps:normal;font-weight:400;letter-sp=
acing:normal;text-align:start;text-indent:0px;text-transform:none;white-spa=
ce:normal;word-spacing:0px;background-color:rgb(250,250,250);text-decoratio=
n-style:initial;text-decoration-color:initial;color:rgb(102,102,0)">;</span=
><span class=3D"gmail-m_-6188734370832073816styled-by-prettify" style=3D"fo=
nt-family:monospace;font-size:10.4px;font-style:normal;font-variant-ligatur=
es:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;te=
xt-align:start;text-indent:0px;text-transform:none;white-space:normal;word-=
spacing:0px;background-color:rgb(250,250,250);text-decoration-style:initial=
;text-decoration-color:initial;color:rgb(0,0,0)"><span>=C2=A0</span></span>=
<span class=3D"gmail-m_-6188734370832073816styled-by-prettify" style=3D"fon=
t-family:monospace;font-size:10.4px;font-style:normal;font-variant-ligature=
s:normal;font-variant-caps:normal;font-weight:400;letter-spacing:normal;tex=
t-align:start;text-indent:0px;text-transform:none;white-space:normal;word-s=
pacing:0px;background-color:rgb(250,250,250);text-decoration-style:initial;=
text-decoration-color:initial;color:rgb(136,0,0)">// f =3D=3D 0.4<br></span=
>Seems pretty related to me.=C2=A0 They've asked for an operator,<br>gi=
ven an example of its use, and described the result, a result<br>they would=
in fact not get if the operator were implemented.=C2=A0</div></div></div><=
/div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAHSYqdYNjp%2B9YmeOtzXRMJ8fDhhdcNETka=
eLU%3D43Xm1UtqDWjw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdYNjp%2=
B9YmeOtzXRMJ8fDhhdcNETkaeLU%3D43Xm1UtqDWjw%40mail.gmail.com</a>.<br />
--001a114446fa7222c7056aaf8ba5--
.
Author: Tony V E <tvaneerd@gmail.com>
Date: Wed, 25 Apr 2018 13:26:29 -0400
Raw View
--0000000000005302cb056aaf9228
Content-Type: text/plain; charset="UTF-8"
On Wed, Apr 25, 2018 at 12:57 PM, Jake Arkinstall <jake.arkinstall@gmail.com
> wrote:
> I'm also in favour of the change. We can talk about the uses of it and the
> pitfalls of floating representation until the cows come home, but that
> doesnt change that there are uses (justifying the existence of fmodf in the
> first place), that it is already deemed useful enough to be effortlessly
> implemented in a variety of other languages, and that the "different code
> for different types" ethos is not the C++ way.
>
> Whether or not I believe that the change is feasible is another matter. I
> can only see three reasonable approaches. The first is to get the C
> community on board. Failing that, we could figure out a way of allowing
> operator functions on primitives without demolishing the language. Failing
> that, we could standardise a wrapping class around certain primitives that
> allows us to embellish them without the negotiations required for the
> previous two approaches.
>
> These are in descending order of usefulness but ascending order of ease.
>
Are any of those worth the time and effort?
If you had 10$ to spend on committee time/direction, how much would you
allocate for this feature?
Doing this feature tends to mean NOT doing something else.
--
Be seeing you,
Tony
--
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 email 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/CAOHCbitVZiLrgQGzDO30-ZkzurRM3oAnvd4UGt%3DXt8Yxp8n_FA%40mail.gmail.com.
--0000000000005302cb056aaf9228
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><div class=3D"gmail_extra"><br><div class=3D"gmail_quo=
te">On Wed, Apr 25, 2018 at 12:57 PM, Jake Arkinstall <span dir=3D"ltr"><=
;<a href=3D"mailto:jake.arkinstall@gmail.com" target=3D"_blank">jake.arkins=
tall@gmail.com</a>></span> wrote:<br><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div=
dir=3D"auto">I'm also in favour of the change. We can talk about the u=
ses of it and the pitfalls of floating representation until the cows come h=
ome, but that doesnt change that there are uses (justifying the existence o=
f fmodf in the first place), that it is already deemed useful enough to be =
effortlessly implemented in a variety of other languages, and that the &quo=
t;different code for different types" ethos is not the C++ way.<div di=
r=3D"auto"><br></div><div dir=3D"auto">Whether or not I believe that the ch=
ange is feasible is another matter. I can only see three reasonable approac=
hes. The first is to get the C community on board. Failing that, we could f=
igure out a way of allowing operator functions on primitives without demoli=
shing the language. Failing that, we could standardise a wrapping class aro=
und certain primitives that allows us to embellish them without the negotia=
tions required for the previous two approaches.</div><div dir=3D"auto"><br>=
</div><div dir=3D"auto">These are in descending order of usefulness but asc=
ending order of ease.=C2=A0</div></div></blockquote><div><br><br></div><div=
class=3D"h5">Are any of those worth the time and effort?<br></div><div cla=
ss=3D"h5">If you had 10$ to spend on committee time/direction, how much wou=
ld you allocate for this feature?<br></div><div class=3D"h5">Doing this fea=
ture tends to mean NOT doing something else.<br></div></div><br>-- <br><div=
class=3D"gmail_signature" data-smartmail=3D"gmail_signature"><div dir=3D"l=
tr"><div>Be seeing you,<br></div>Tony<br></div></div>
</div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAOHCbitVZiLrgQGzDO30-ZkzurRM3oAnvd4U=
Gt%3DXt8Yxp8n_FA%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">h=
ttps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAOHCbitVZiLrgQ=
GzDO30-ZkzurRM3oAnvd4UGt%3DXt8Yxp8n_FA%40mail.gmail.com</a>.<br />
--0000000000005302cb056aaf9228--
.
Author: Hyman Rosen <hyman.rosen@gmail.com>
Date: Wed, 25 Apr 2018 13:37:11 -0400
Raw View
--000000000000c627ce056aafb96e
Content-Type: text/plain; charset="UTF-8"
On Wed, Apr 25, 2018 at 1:17 PM, Jake Arkinstall <jake.arkinstall@gmail.com>
wrote:
>
> It is intuitive to anyone who understands floating point arithmetic.
>
And when someone does 0.5f % 0.1f and gets .099999994f, is that going to
be intuitive to them too? Everyone is going to try to use this operator to
do decimal
conversion (because what else do people want this operator for?) and
they're going
to fail.
--
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 email 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/CAHSYqdZJ8Rcn%2B6Pto2%2B%2B6RLOaYwWCBV8zcoUJYciYnCsO-1Avg%40mail.gmail.com.
--000000000000c627ce056aafb96e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On W=
ed, Apr 25, 2018 at 1:17 PM, Jake Arkinstall <span dir=3D"ltr"><<a href=
=3D"mailto:jake.arkinstall@gmail.com" target=3D"_blank">jake.arkinstall@gma=
il.com</a>></span> wrote:<blockquote class=3D"gmail_quote" style=3D"marg=
in:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1e=
x"><div dir=3D"auto"><div dir=3D"auto">It is intuitive to anyone who unders=
tands floating point arithmetic.</div></div></blockquote><div><br>And when =
someone does <font face=3D"monospace, monospace">0.5f % 0.1f</font> and get=
s=C2=A0<font face=3D"monospace, monospace">.099999994f</font>, is that goin=
g to<br>be intuitive to them too?=C2=A0 Everyone is going to try to use thi=
s operator to do decimal<br>conversion (because what else do people want th=
is operator for?) and they're going<br>to fail.</div></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAHSYqdZJ8Rcn%2B6Pto2%2B%2B6RLOaYwWCB=
V8zcoUJYciYnCsO-1Avg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdZJ8R=
cn%2B6Pto2%2B%2B6RLOaYwWCBV8zcoUJYciYnCsO-1Avg%40mail.gmail.com</a>.<br />
--000000000000c627ce056aafb96e--
.
Author: Jake Arkinstall <jake.arkinstall@gmail.com>
Date: Wed, 25 Apr 2018 18:22:32 +0000
Raw View
--0000000000006127cf056ab05b4e
Content-Type: text/plain; charset="UTF-8"
The real stumbling block will be when they print it to the terminal and it
rounds to 0.1. But this is trivial; 0.1 doesn't exist in a finite binary
type. If they don't know that when they write the code then a necessary
learning exercise presents itself to them. As soon as they realise that
it's exactly the same problem as 3/3 = 0.99999... if you only have limited
paper to work on, it is no longer a stumbling block. One would hope.
The same thing happens with fmod and fmodf. Was the discrepancy between
decimal and binary representation of rationals considered a barrier when
these functions were introduced too?
We are talking about an operator that performs an already understood
function, allowing us to use a single piece of code on a more generic
numerical type. This is the sole reason that I am contesting the idea that
this is a reason not to have the operation - the existences of fmod and
fmodf provide that justification.
On Wed, 25 Apr 2018, 18:37 Hyman Rosen, <hyman.rosen@gmail.com> wrote:
> On Wed, Apr 25, 2018 at 1:17 PM, Jake Arkinstall <
> jake.arkinstall@gmail.com> wrote:
>>
>> It is intuitive to anyone who understands floating point arithmetic.
>>
>
> And when someone does 0.5f % 0.1f and gets .099999994f, is that going to
> be intuitive to them too? Everyone is going to try to use this operator
> to do decimal
> conversion (because what else do people want this operator for?) and
> they're going
> to fail.
>
> --
> 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
> email 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/CAHSYqdZJ8Rcn%2B6Pto2%2B%2B6RLOaYwWCBV8zcoUJYciYnCsO-1Avg%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdZJ8Rcn%2B6Pto2%2B%2B6RLOaYwWCBV8zcoUJYciYnCsO-1Avg%40mail.gmail.com?utm_medium=email&utm_source=footer>
> .
>
--
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 email 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/CAC%2B0CCO1NY8UQMW5w%2Bjc6JRHJ%2BnfYHoX%3DY%3DrapmLHMNrUpWDsg%40mail.gmail.com.
--0000000000006127cf056ab05b4e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"auto"><div dir=3D"auto">The real stumbling block will be when t=
hey print it to the terminal and it rounds to 0.1. But this is trivial; 0.1=
doesn't exist in a finite binary type. If they don't know that whe=
n they write the code then a necessary learning exercise presents itself to=
them. As soon as they realise that it's exactly the same problem as 3/=
3 =3D 0.99999... if you only have limited paper to work on, it is no longer=
a stumbling block. One would hope.</div><div dir=3D"auto"><br></div>The sa=
me thing happens with fmod and fmodf. Was the discrepancy between decimal a=
nd binary representation of rationals considered a barrier when these funct=
ions were introduced too?<div dir=3D"auto"><div dir=3D"auto"><div dir=3D"au=
to"><br></div><div dir=3D"auto">We are talking about an operator that perfo=
rms an already understood function, allowing us to use a single piece of co=
de on a more generic numerical type. This is the sole reason that I am cont=
esting the idea that this is a reason not to have the operation - the exist=
ences of fmod and fmodf provide that justification.</div></div></div></div>=
<br><div class=3D"gmail_quote"><div dir=3D"ltr">On Wed, 25 Apr 2018, 18:37 =
Hyman Rosen, <<a href=3D"mailto:hyman.rosen@gmail.com">hyman.rosen@gmail=
..com</a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr=
"><div class=3D"gmail_extra"><div class=3D"gmail_quote">On Wed, Apr 25, 201=
8 at 1:17 PM, Jake Arkinstall <span dir=3D"ltr"><<a href=3D"mailto:jake.=
arkinstall@gmail.com" target=3D"_blank" rel=3D"noreferrer">jake.arkinstall@=
gmail.com</a>></span> wrote:<blockquote class=3D"gmail_quote" style=3D"m=
argin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left=
:1ex"><div dir=3D"auto"><div dir=3D"auto">It is intuitive to anyone who und=
erstands floating point arithmetic.</div></div></blockquote><div><br>And wh=
en someone does <font face=3D"monospace, monospace">0.5f % 0.1f</font> and =
gets=C2=A0<font face=3D"monospace, monospace">.099999994f</font>, is that g=
oing to<br>be intuitive to them too?=C2=A0 Everyone is going to try to use =
this operator to do decimal<br>conversion (because what else do people want=
this operator for?) and they're going<br>to fail.</div></div></div></d=
iv>
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank" rel=3D"noreferrer">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank" rel=3D"noreferrer">std-proposals@isocpp.org</a>.<br=
>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAHSYqdZJ8Rcn%2B6Pto2%2B%2B6RLOaYwWCB=
V8zcoUJYciYnCsO-1Avg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Df=
ooter" target=3D"_blank" rel=3D"noreferrer">https://groups.google.com/a/iso=
cpp.org/d/msgid/std-proposals/CAHSYqdZJ8Rcn%2B6Pto2%2B%2B6RLOaYwWCBV8zcoUJY=
ciYnCsO-1Avg%40mail.gmail.com</a>.<br>
</blockquote></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAC%2B0CCO1NY8UQMW5w%2Bjc6JRHJ%2BnfYH=
oX%3DY%3DrapmLHMNrUpWDsg%40mail.gmail.com?utm_medium=3Demail&utm_source=3Df=
ooter">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAC%2B0=
CCO1NY8UQMW5w%2Bjc6JRHJ%2BnfYHoX%3DY%3DrapmLHMNrUpWDsg%40mail.gmail.com</a>=
..<br />
--0000000000006127cf056ab05b4e--
.
Author: Thiago Macieira <thiago@macieira.org>
Date: Wed, 25 Apr 2018 13:51:16 -0700
Raw View
On Wednesday, 25 April 2018 10:23:44 PDT Tony V E wrote:
> > As I said before, if floating-point % existed, then 13.0f % 2.6f would
> > result in
> > 0.40000057220458984375f exactly. The values written as 0.40000056f,
> > 0.40000057f, and 0.40000058f all convert to that value, but the value
> > written
> > as 0.4f does not, being exactly equal to 0.4000000059604644775390625f.
> >
> > This is not at all intuitive, even before you get to compiler permission
> > to keep
> > expression results in extended precision. Making an operator that fools
> > people
> > is going to make them unhappy.
>
> Does fmod() currently have these same issues?
It would help if we had a concrete example to test with. With infinite
precision, 13.0 % 2.6 should be zero, not 0.4.
In any case, a quick check with Godbolt shows the operation is not done in
infinite or even extended precision:
https://godbolt.org/g/AxCUnE
This shows the result of fmodf(13, 2.6) = 4.76837158E-7, not zero. Worse,
fmod(13, 2.6) is 2.5999999, which *is* 2.6. This is *extremely* surprising for
anyone who fails to stop and think about how floating point is actually
represented.
The other example in the thread (0.5 % 0.1) makes more sense. It should also
be zero, but the result offered by fmodf is within 1 ufp of 0.1. And like 13 %
2.6, the result with fmod is 0.1.
Because of those surprises, I'd advocate *not* to make a language operator.
Best leave it to a function which one needs to read the documentation for and
may thus find suitable warnings.
--
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
Software Architect - Intel Open Source Technology Center
--
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 email 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/6935557.ItHtA4Vhkd%40tjmaciei-mobl1.
.
Author: Hyman Rosen <hyman.rosen@gmail.com>
Date: Wed, 25 Apr 2018 22:14:09 +0000
Raw View
--000000000000b324ed056ab397f7
Content-Type: text/plain; charset="UTF-8"
>
> It would help if we had a concrete example to test with. With infinite
> precision, 13.0 % 2.6 should be zero, not 0.4.
>
Sorry, I meant 2.1, not 2.6, as in the OP's example.
--
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 email 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/CAHSYqdbdo%2Bj_bbJtLOcuZGjDr0ZJ0v%3D0hvcNrVKMQZ9JhO%3D41Q%40mail.gmail.com.
--000000000000b324ed056ab397f7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_quote"><blockquote class=3D"gmail_quot=
e" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">=
It would help if we had a concrete example to test with. With infinite <br>
precision, 13.0 % 2.6 should be zero, not 0.4.<br></blockquote><div><br>Sor=
ry, I meant 2.1, not 2.6, as in the OP's example.</div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAHSYqdbdo%2Bj_bbJtLOcuZGjDr0ZJ0v%3D0=
hvcNrVKMQZ9JhO%3D41Q%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoote=
r">https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdbdo%=
2Bj_bbJtLOcuZGjDr0ZJ0v%3D0hvcNrVKMQZ9JhO%3D41Q%40mail.gmail.com</a>.<br />
--000000000000b324ed056ab397f7--
.
Author: John McFarlane <john@mcfarlane.name>
Date: Thu, 26 Apr 2018 00:55:09 +0000
Raw View
--001a11425ce480f094056ab5d784
Content-Type: text/plain; charset="UTF-8"
On Wed, Apr 25, 2018 at 9:31 AM Jakob Riedle <jakob.riedle@gmail.com> wrote:
> Am Dienstag, 24. April 2018 11:43:44 UTC+2 schrieb John McFarlane:
>>
>> The remainder can be thought of as the value that is lost as a result of
>> rounding down of the quotient. The rounding occurs because integers have a
>> fixed resolution of 1. Floats do not.
>>
>> For integer division, if n/d=q and n%d=r then if follows that q*d+r=n. So
>> having a remainder of 0.4f in your example only makes sense if 13.f / 2.1f
>> == 6 and that would change the behavior of floating-point division.
>>
>
> The modulo operation clearly has only one intuitive behaviour (excluded
> signed operands) which additionally has a significant amount of users that
> would benefit from such a change, regardles of whether the committee
> prioritises that way.
>
Then you would not like fixed-point modulo behavior which uses integer
arithmetic but at scales which are powers of two.
Take the example of a fixed-point number with exponent +1. The resolution
of such a number is 2. If 10 is represented with this type, then you can
only take 3 away from it twice and you end up with a remainder of 4. This
holds:
10/3 = 2r4 // numerator=10, denominator=3, quotient=2 and remainder=4
working back: 3*2+4=10 // d*q+r = n
(Example: https://godbolt.org/g/4w6Rpf <https://t.co/RKxqBEQ2MV>)
So while modulo operation has only one intuitive behavior for integers (and
floats observing integer arithmetic), it has a more general behavior which
is unintuitive but nevertheless useful.
> I am in favor of this change. +1
>
> Jakob
>
>
> --
> 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
> email 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/a2825d04-5d39-4ce1-bcf3-f20db6fcd430%40isocpp.org
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/a2825d04-5d39-4ce1-bcf3-f20db6fcd430%40isocpp.org?utm_medium=email&utm_source=footer>
> .
>
--
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 email 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/CABPJVnQtHkDhDkqUT8c1dJdT5y4cdbF83dAKCCAcCJbJeGcOTw%40mail.gmail.com.
--001a11425ce480f094056ab5d784
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">On Wed, Apr 25=
, 2018 at 9:31 AM Jakob Riedle <<a href=3D"mailto:jakob.riedle@gmail.com=
" target=3D"_blank">jakob.riedle@gmail.com</a>> wrote:<br></div><blockqu=
ote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc s=
olid;padding-left:1ex"><div dir=3D"ltr">Am Dienstag, 24. April 2018 11:43:4=
4 UTC+2 schrieb John McFarlane:<blockquote class=3D"gmail_quote" style=3D"m=
argin:0;margin-left:0.8ex;border-left:1px #ccc solid;padding-left:1ex"><div=
dir=3D"ltr"><div>The remainder can be thought of as the value that is lost=
as a result of rounding down of the quotient.=20
The rounding occurs because integers have a fixed resolution of 1. Floats d=
o not.<br></div><div><br></div><div>For integer division, if n/d=3Dq
and n%d=3Dr then if follows that q*d+r=3Dn.=20
So having a remainder of 0.4f in your example only makes sense if 13.f / 2.=
1f =3D=3D 6 and that would change the behavior of floating-point division.<=
/div></div></blockquote><div><br></div></div></blockquote><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex"><div dir=3D"ltr"><div></div><div>The modulo operation clearly=
has only one intuitive behaviour (excluded signed operands) which addition=
ally has a significant amount of users that would benefit from such a chang=
e, regardles of whether the committee prioritises that way.</div></div></bl=
ockquote><div><br></div><div>Then you would not like fixed-point modulo beh=
avior which uses integer arithmetic but at scales which are powers of two. =
<br><br>Take the example of a fixed-point number with exponent +1. The reso=
lution of such a number is 2. If 10 is represented with this type, then you=
can only take 3 away from it twice and you end up with a remainder of 4. T=
his holds:<br></div><div><br></div></div><div dir=3D"ltr"><div dir=3D"ltr">=
<div class=3D"gmail_quote"><div>10/3 =3D 2r4=C2=A0 // numerator=3D10, denom=
inator=3D3, quotient=3D2 and remainder=3D4<br></div><div><br></div><div>wor=
king back: 3*2+4=3D10=C2=A0 // d*q+r =3D n<br><br></div><div>(Example: <a h=
ref=3D"https://t.co/RKxqBEQ2MV" rel=3D"nofollow noopener" dir=3D"ltr" class=
=3D"m_6135860557640747232m_6819893674514831458inbox-inbox-twitter-timeline-=
link" title=3D"https://godbolt.org/g/4w6Rpf" target=3D"_blank"><span class=
=3D"m_6135860557640747232m_6819893674514831458inbox-inbox-tco-ellipsis"></s=
pan><span class=3D"m_6135860557640747232m_6819893674514831458inbox-inbox-in=
visible">https://</span><span class=3D"m_6135860557640747232m_6819893674514=
831458inbox-inbox-js-display-url">godbolt.org/g/4w6Rpf</span></a>)</div><di=
v><br></div><div class=3D"gmail_quote">So while modulo operation has only o=
ne intuitive behavior for integers (and floats observing integer arithmetic=
), it has a more general behavior which is unintuitive but nevertheless use=
ful.<br><br><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bo=
rder-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr"><div><br></div>=
<div>I am in favor of this change. +1</div><div><br></div><div>Jakob</div><=
div><br></div><div><br></div></div>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/a2825d04-5d39-4ce1-bcf3-f20db6fcd430%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter" target=3D"_blank">=
https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/a2825d04-5d39-=
4ce1-bcf3-f20db6fcd430%40isocpp.org</a>.<br>
</blockquote></div></div></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CABPJVnQtHkDhDkqUT8c1dJdT5y4cdbF83dAK=
CCAcCJbJeGcOTw%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter">htt=
ps://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CABPJVnQtHkDhDkqU=
T8c1dJdT5y4cdbF83dAKCCAcCJbJeGcOTw%40mail.gmail.com</a>.<br />
--001a11425ce480f094056ab5d784--
.
Author: Hyman Rosen <hyman.rosen@gmail.com>
Date: Thu, 26 Apr 2018 14:08:39 +0000
Raw View
--000000000000440fa7056ac0ed32
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
On Wed, Apr 25, 2018 at 8:55 PM John McFarlane <john@mcfarlane.name> wrote:
> Then you would not like fixed-point modulo behavior which uses integer
> arithmetic but at scales which are powers of two.
>
Your funny numbers have an operator% defined, though, so maybe you're
supporting the OP :-)
The basic problem is that *a%b =E2=89=9D a-b**=C3=97**=E2=8C=8Aa=C3=B7b=E2=
=8C=8B*, and the division will not
give people the
result they expect from examining the numbers they have written in the
code, or otherwise
converted from decimal to binary, because those numbers are usually a tiny
bit larger or a
tiny bit smaller than their decimal forms. A lot of people don't
understand this, and I would
guess that proportion is particularly high among those who are asking for a
float operator%.
If they knew what it would do, they wouldn't want it, because it doesn't do
what they want.
--=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/CAHSYqdYBu%2BxQj3yuQd%2B88xT1Ea7pnibVDP6_dHgvAmy=
K-Z4d_g%40mail.gmail.com.
--000000000000440fa7056ac0ed32
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">On Wed, Apr 25=
, 2018 at 8:55 PM John McFarlane <<a href=3D"mailto:john@mcfarlane.name"=
>john@mcfarlane.name</a>> wrote:</div><blockquote class=3D"gmail_quote" =
style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pa=
dding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_quote"><div>Then you w=
ould not like fixed-point modulo behavior which uses integer arithmetic but=
at scales which are powers of two.</div></div></div></blockquote><div><br>=
<font face=3D"arial, helvetica, sans-serif">Your funny numbers have an </fo=
nt><font face=3D"monospace, monospace">operator%</font><font face=3D"arial,=
helvetica, sans-serif"> defined, though, so maybe you're supporting th=
e OP :-)</font><br><br><font face=3D"arial, helvetica, sans-serif">The basi=
c problem is that=C2=A0</font><b><font face=3D"monospace, monospace">a%b =
=E2=89=9D a-b</font></b><font face=3D"monospace, monospace"><b>=C3=97</b></=
font><b><font face=3D"monospace, monospace">=E2=8C=8Aa=C3=B7b=E2=8C=8B</fon=
t></b><font face=3D"arial, helvetica, sans-serif">, and the division will n=
ot give people the</font></div><div><font face=3D"arial, helvetica, sans-se=
rif">result they expect from examining the numbers they have written in the=
code, or otherwise</font><br><font face=3D"arial, helvetica, sans-serif">c=
onverted from decimal to binary, because those numbers are usually a tiny b=
it larger or a</font><br><font face=3D"arial, helvetica, sans-serif">tiny b=
it smaller than their decimal forms.=C2=A0 A lot of people don't unders=
tand this, and I would<br>guess that proportion is particularly high among =
those who are asking for a float </font><font face=3D"monospace, monospace"=
>operator%</font><font face=3D"arial, helvetica, sans-serif">.<br>If they k=
new what it would do, they wouldn't want it, because it doesn't do =
what they want.</font></div></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAHSYqdYBu%2BxQj3yuQd%2B88xT1Ea7pnibV=
DP6_dHgvAmyK-Z4d_g%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdYBu%2B=
xQj3yuQd%2B88xT1Ea7pnibVDP6_dHgvAmyK-Z4d_g%40mail.gmail.com</a>.<br />
--000000000000440fa7056ac0ed32--
.
Author: John McFarlane <john@mcfarlane.name>
Date: Thu, 26 Apr 2018 15:31:20 +0000
Raw View
--001a1145a414fab79c056ac21401
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
On Thu, Apr 26, 2018, 07:08 Hyman Rosen <hyman.rosen@gmail.com> wrote:
> On Wed, Apr 25, 2018 at 8:55 PM John McFarlane <john@mcfarlane.name>
> wrote:
>
>> Then you would not like fixed-point modulo behavior which uses integer
>> arithmetic but at scales which are powers of two.
>>
>
> Your funny numbers have an operator% defined, though, so maybe you're
> supporting the OP :-)
>
I'm not. The operator I'm describing fixed-point % -- just like integer %
does.
>
> The basic problem is that *a%b =E2=89=9D a-b**=C3=97**=E2=8C=8Aa=C3=B7b=
=E2=8C=8B*, and the division will
> not give people the
> result they expect from examining the numbers they have written in the
> code, or otherwise
> converted from decimal to binary, because those numbers are usually a tin=
y
> bit larger or a
> tiny bit smaller than their decimal forms. A lot of people don't
> understand this, and I would
> guess that proportion is particularly high among those who are asking for
> a float operator%.
> If they knew what it would do, they wouldn't want it, because it doesn't
> do what they want.
>
I agree but it sounds like you are still talking mostly about
floating-point numbers. With binary fixed-point, I cannot do anything about
the confusion caused by conversion from decimal fractions but at least the
results are reasonably predictable, easy to calculate and completely
precise. Given precise starting values, you can work back and get the exact
dividend. Trying to figure out how floating-point modulo will turn out is a
tougher task.
--=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
> email 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/CAHSYqdYBu%2=
BxQj3yuQd%2B88xT1Ea7pnibVDP6_dHgvAmyK-Z4d_g%40mail.gmail.com
> <https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CAHSYqdYBu%=
2BxQj3yuQd%2B88xT1Ea7pnibVDP6_dHgvAmyK-Z4d_g%40mail.gmail.com?utm_medium=3D=
email&utm_source=3Dfooter>
> .
>
--=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/CABPJVnRubvdoTFCs_S9G5Fgsxt6Ebmm8D%3DsVx1Gv%3DCo=
5VtpV_g%40mail.gmail.com.
--001a1145a414fab79c056ac21401
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr">On Thu, Apr 26=
, 2018, 07:08 Hyman Rosen <<a href=3D"mailto:hyman.rosen@gmail.com" targ=
et=3D"_blank">hyman.rosen@gmail.com</a>> wrote:<br></div><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa=
dding-left:1ex"><div dir=3D"ltr"><div class=3D"gmail_quote"><div dir=3D"ltr=
">On Wed, Apr 25, 2018 at 8:55 PM John McFarlane <<a href=3D"mailto:john=
@mcfarlane.name" target=3D"_blank">john@mcfarlane.name</a>> wrote:</div>=
<blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-=
left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr"><div cla=
ss=3D"gmail_quote"><div>Then you would not like fixed-point modulo behavior=
which uses integer arithmetic but at scales which are powers of two.</div>=
</div></div></blockquote></div></div><div dir=3D"ltr"><div class=3D"gmail_q=
uote"><div><br><font face=3D"arial, helvetica, sans-serif">Your funny numbe=
rs have an </font><font face=3D"monospace, monospace">operator%</font><font=
face=3D"arial, helvetica, sans-serif"> defined, though, so maybe you'r=
e supporting the OP :-)</font></div></div></div></blockquote><div><br></div=
><div>I'm not. The operator I'm describing fixed-point % -- just li=
ke integer % does. <br></div><blockquote class=3D"gmail_quote" style=3D"mar=
gin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=3D"ltr=
"><div class=3D"gmail_quote"><div><br><font face=3D"arial, helvetica, sans-=
serif">The basic problem is that=C2=A0</font><b><font face=3D"monospace, mo=
nospace">a%b =E2=89=9D a-b</font></b><font face=3D"monospace, monospace"><b=
>=C3=97</b></font><b><font face=3D"monospace, monospace">=E2=8C=8Aa=C3=B7b=
=E2=8C=8B</font></b><font face=3D"arial, helvetica, sans-serif">, and the d=
ivision will not give people the</font></div><div><font face=3D"arial, helv=
etica, sans-serif">result they expect from examining the numbers they have =
written in the code, or otherwise</font><br><font face=3D"arial, helvetica,=
sans-serif">converted from decimal to binary, because those numbers are us=
ually a tiny bit larger or a</font><br><font face=3D"arial, helvetica, sans=
-serif">tiny bit smaller than their decimal forms.=C2=A0 A lot of people do=
n't understand this, and I would<br>guess that proportion is particular=
ly high among those who are asking for a float </font><font face=3D"monospa=
ce, monospace">operator%</font><font face=3D"arial, helvetica, sans-serif">=
..<br>If they knew what it would do, they wouldn't want it, because it d=
oesn't do what they want.</font></div></div></div></blockquote></div><d=
iv><br></div><div>I agree but it sounds like you are still talking mostly a=
bout floating-point numbers. With binary fixed-point, I cannot do anything =
about the confusion caused by conversion from decimal fractions but at leas=
t the results are reasonably predictable, easy to calculate and completely =
precise. Given precise starting values, you can work back and get the exact=
dividend. Trying to figure out how floating-point modulo will turn out is =
a tougher task.<br><br></div><div class=3D"gmail_quote"><blockquote class=
=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padd=
ing-left:1ex">
<p></p>
-- <br>
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br>
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org" target=3D"_=
blank">std-proposals+unsubscribe@isocpp.org</a>.<br>
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org" target=3D"_blank">std-proposals@isocpp.org</a>.<br>
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CAHSYqdYBu%2BxQj3yuQd%2B88xT1Ea7pnibV=
DP6_dHgvAmyK-Z4d_g%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfoo=
ter" target=3D"_blank">https://groups.google.com/a/isocpp.org/d/msgid/std-p=
roposals/CAHSYqdYBu%2BxQj3yuQd%2B88xT1Ea7pnibVDP6_dHgvAmyK-Z4d_g%40mail.gma=
il.com</a>.<br>
</blockquote></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/CABPJVnRubvdoTFCs_S9G5Fgsxt6Ebmm8D%3D=
sVx1Gv%3DCo5VtpV_g%40mail.gmail.com?utm_medium=3Demail&utm_source=3Dfooter"=
>https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/CABPJVnRubvdo=
TFCs_S9G5Fgsxt6Ebmm8D%3DsVx1Gv%3DCo5VtpV_g%40mail.gmail.com</a>.<br />
--001a1145a414fab79c056ac21401--
.
Author: 3dw4rd@verizon.net
Date: Thu, 24 May 2018 12:24:19 -0700 (PDT)
Raw View
------=_Part_8594_2077767671.1527189859280
Content-Type: multipart/alternative;
boundary="----=_Part_8595_2132867547.1527189859280"
------=_Part_8595_2132867547.1527189859280
Content-Type: text/plain; charset="UTF-8"
On Tuesday, April 24, 2018 at 6:29:36 AM UTC-4, Tony V E wrote:
>
> Would you be equally happy if fmod was made constexpr?
> (instead of % for floats)
>
>
I think that would be a great idea for most or all of the elementary
transcendental functions.
My understanding is that writing to the global errno is what prevents this.
For fmod: If a *domain error* occurs, the global variable errno
<http://www.cplusplus.com/errno> is set to EDOM
<http://www.cplusplus.com/EDOM>.
This could happen for y == 0.
Maybe we can have overloads that return error_code?
That's a whole other conversation though.
--
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 email 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/25ab6eff-4e03-4f25-8209-e9e609b8c575%40isocpp.org.
------=_Part_8595_2132867547.1527189859280
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Tuesday, April 24, 2018 at 6:29:36 AM UTC-4, To=
ny V E wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margin-le=
ft: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div style=3D"bac=
kground-color:rgb(255,255,255);line-height:initial" lang=3D"en-US"> =
=
<div style=3D"width:100%;font-size:initial;font-family:Calibri,'Slat=
e Pro',sans-serif,sans-serif;color:rgb(31,73,125);text-align:initial;ba=
ckground-color:rgb(255,255,255)">Would you be equally happy if fmod was mad=
e constexpr?=C2=A0</div><div style=3D"width:100%;font-size:initial;font-fam=
ily:Calibri,'Slate Pro',sans-serif,sans-serif;color:rgb(31,73,125);=
text-align:initial;background-color:rgb(255,255,255)">(instead of % for flo=
ats)</div>=C2=A0</div></blockquote><div><br></div><div>I think that would b=
e a great idea for most or all of the elementary transcendental functions.<=
/div><div>My understanding is that writing to the global errno is what prev=
ents this.</div><div>For fmod: If a <i>domain error</i> occurs, the global =
variable <samp><a href=3D"http://www.cplusplus.com/errno">errno</a></samp> =
is set to <samp><a href=3D"http://www.cplusplus.com/EDOM">EDOM</a></samp>.<=
/div><div>This could happen for y =3D=3D 0.<br></div><div><br></div><div>Ma=
ybe we can have overloads that return error_code?</div><div><br></div><div>=
That's a whole other conversation though.</div><div><br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/25ab6eff-4e03-4f25-8209-e9e609b8c575%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/25ab6eff-4e03-4f25-8209-e9e609b8c575=
%40isocpp.org</a>.<br />
------=_Part_8595_2132867547.1527189859280--
------=_Part_8594_2077767671.1527189859280--
.
Author: 3dw4rd@verizon.net
Date: Thu, 24 May 2018 12:57:28 -0700 (PDT)
Raw View
------=_Part_8948_1019839569.1527191848730
Content-Type: multipart/alternative;
boundary="----=_Part_8949_1024558071.1527191848731"
------=_Part_8949_1024558071.1527191848731
Content-Type: text/plain; charset="UTF-8"
On Tuesday, April 24, 2018 at 6:43:37 AM UTC-4, Jeff Hammond wrote:
>
> Did you spend any time researching this topic before you posted? The
> issue with your example isn't fmod but constexpr in <cmath> and the
> proposal to support this is linked from the top google search hit for
> "constexpr c++ cmath".
>
>
> https://stackoverflow.com/questions/42189190/why-doesnt-the-c-standard-library-provide-constexpr-versions-of-the-cmath-fun
> points to
> http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0533r0.pdf,
> which contains
>
> constexpr float fmod(float x, float y); // see [library.c]
> constexpr double fmod(double x, double y);
> constexpr long double fmod(long double x, long double y); // see
> [library.c]
> constexpr float fmodf(float x, float y);
> constexpr long double fmodl(long double x, long double y);
>
>
Narrow types to the rescue:
template<typename Tp>
remquo_t
{ Tp rem; int quo; };
remquo_t<Tp> remquo(Tp x, Tp y);
template<typename Tp>
modf_t
{ Tp rem, quo; };
modf_t<Tp> modf(float value);
These are especially useful with decomp decls:
const auto [r, q] = remquo(x, y);
--
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 email 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/ae0a9a32-78a0-4c22-bf1d-8b9b27b3f5dc%40isocpp.org.
------=_Part_8949_1024558071.1527191848731
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
<div dir=3D"ltr"><br><br>On Tuesday, April 24, 2018 at 6:43:37 AM UTC-4, Je=
ff Hammond wrote:<blockquote class=3D"gmail_quote" style=3D"margin: 0;margi=
n-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;"><div dir=3D"l=
tr"><div>Did you spend any time researching this topic before you posted?=
=C2=A0 The issue with your example isn't fmod but constexpr in <cmat=
h> and the proposal to support this is linked from the top google search=
hit for "constexpr c++ cmath".</div><div><br></div><a href=3D"ht=
tps://stackoverflow.com/questions/42189190/why-doesnt-the-c-standard-librar=
y-provide-constexpr-versions-of-the-cmath-fun" target=3D"_blank" rel=3D"nof=
ollow" onmousedown=3D"this.href=3D'https://www.google.com/url?q\x3dhttp=
s%3A%2F%2Fstackoverflow.com%2Fquestions%2F42189190%2Fwhy-doesnt-the-c-stand=
ard-library-provide-constexpr-versions-of-the-cmath-fun\x26sa\x3dD\x26sntz\=
x3d1\x26usg\x3dAFQjCNEP6FH53T4QNVuIZFC0NQ3JfN70tw';return true;" onclic=
k=3D"this.href=3D'https://www.google.com/url?q\x3dhttps%3A%2F%2Fstackov=
erflow.com%2Fquestions%2F42189190%2Fwhy-doesnt-the-c-standard-library-provi=
de-constexpr-versions-of-the-cmath-fun\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAF=
QjCNEP6FH53T4QNVuIZFC0NQ3JfN70tw';return true;">https://stackoverflow.c=
om/<wbr>questions/42189190/why-doesnt-<wbr>the-c-standard-library-<wbr>prov=
ide-constexpr-versions-of-<wbr>the-cmath-fun</a> points to=C2=A0<a href=3D"=
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2017/p0533r0.pdf" target=
=3D"_blank" rel=3D"nofollow" onmousedown=3D"this.href=3D'http://www.goo=
gle.com/url?q\x3dhttp%3A%2F%2Fwww.open-std.org%2Fjtc1%2Fsc22%2Fwg21%2Fdocs%=
2Fpapers%2F2017%2Fp0533r0.pdf\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNGA2zR=
NsOclG8l8IpMF4_2pIKNdPQ';return true;" onclick=3D"this.href=3D'http=
://www.google.com/url?q\x3dhttp%3A%2F%2Fwww.open-std.org%2Fjtc1%2Fsc22%2Fwg=
21%2Fdocs%2Fpapers%2F2017%2Fp0533r0.pdf\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dA=
FQjCNGA2zRNsOclG8l8IpMF4_2pIKNdPQ';return true;">http://www.open-std.or=
g/<wbr>jtc1/sc22/wg21/docs/papers/<wbr>2017/p0533r0.pdf</a>, which contains=
<div><br></div><div>constexpr float fmod(float x, float y); // see [library=
..c]</div><div>constexpr double fmod(double x, double y);</div><div>constexp=
r long double fmod(long double x, long double y); // see [library.c]</div><=
div>constexpr float fmodf(float x, float y);</div><div>constexpr long doubl=
e fmodl(long double x, long double y);<div><div><br></div></div></div></div=
></blockquote><div>=C2=A0</div><div>Narrow types to the rescue:</div><div>t=
emplate<typename Tp></div><div>=C2=A0 remquo_t</div><div>=C2=A0 { Tp =
rem; int quo; };</div><div><br></div><div>remquo_t<Tp> remquo(Tp x, T=
p y);</div><div><br></div><div><div>template<typename Tp></div><div>=
=C2=A0 modf_t</div><div>=C2=A0 { Tp rem, quo; };</div><div><br></div>modf_t=
<Tp> modf(float value);</div><div><br></div><div>These are especially=
useful with decomp decls:</div><div><br></div><div>const auto [r, q] =3D r=
emquo(x, y);</div><div><br></div></div>
<p></p>
-- <br />
You received this message because you are subscribed to the Google Groups &=
quot;ISO C++ Standard - Future Proposals" group.<br />
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to <a href=3D"mailto:std-proposals+unsubscribe@isocpp.org">std-proposa=
ls+unsubscribe@isocpp.org</a>.<br />
To post to this group, send email to <a href=3D"mailto:std-proposals@isocpp=
..org">std-proposals@isocpp.org</a>.<br />
To view this discussion on the web visit <a href=3D"https://groups.google.c=
om/a/isocpp.org/d/msgid/std-proposals/ae0a9a32-78a0-4c22-bf1d-8b9b27b3f5dc%=
40isocpp.org?utm_medium=3Demail&utm_source=3Dfooter">https://groups.google.=
com/a/isocpp.org/d/msgid/std-proposals/ae0a9a32-78a0-4c22-bf1d-8b9b27b3f5dc=
%40isocpp.org</a>.<br />
------=_Part_8949_1024558071.1527191848731--
------=_Part_8948_1019839569.1527191848730--
.