<div dir="ltr">Hi Chris,<br><div class="gmail_extra"><br><div class="gmail_quote">2017-01-12 13:17 GMT+01:00 Chris Angelico <span dir="ltr"><<a href="mailto:rosuav@gmail.com" target="_blank">rosuav@gmail.com</a>></span>:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Most of the time one of my students talks to me about decimal vs<br>
binary, they're thinking that a decimal literal (or converting the<br>
default non-integer literal to be decimal) is a panacea to the "0.1 +<br>
0.2 != 0.3" problem. </blockquote><div><br></div><div>Indeed. Decimal also doesn't solve the</div><div>1/3</div><div>issue.</div><div><br></div><div>I don't understand why people always talk about Decimal,</div><div>if you want math to work "right" you probably want fractions. </div><div><br></div><div>(With the understanding that this is for still limited value of "right".)</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Perhaps the real solution is a written-up<br>
explanation of why binary floating point is actually a good thing, and<br>
not just a backward-compatibility requirement?<br></blockquote><div><br></div><div>I have sometimes considered writing up "Why the aliens of Epsilon Eridani,</div><div>whose computers use 13-valued logic, still use floating point numbers</div><div>with base 2."</div><div><br></div><div>(Short overview: analysis form first principles shows that the base should be:</div><div>1. an integral number > 1 and</div><div>2. as small as possible (to minmax the relative rounding error))</div><div><br></div><div>The list of candidate bases satisfying these criteria is: 2.</div><div><br></div><div>Stephan</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
ChrisA<br>
<div class="gmail-HOEnZb"><div class="gmail-h5">______________________________<wbr>_________________<br>
Python-ideas mailing list<br>
<a href="mailto:Python-ideas@python.org">Python-ideas@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/python-ideas" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/python-ideas</a><br>
Code of Conduct: <a href="http://python.org/psf/codeofconduct/" rel="noreferrer" target="_blank">http://python.org/psf/<wbr>codeofconduct/</a><br>
</div></div></blockquote></div><br></div></div>