<div dir="ltr">maybe so, but having a semantics by default is huge, and honestly i'm not super interested in optimizations that merely change one infinity for another. What would the alternative semantics be? Whatever it is, how will we communicate it to our users? GHC's generally been (by accidenta) IEEE compliant, changing that will possibly break someones code! (perhaps). Also who's going to specify this alternative semantics and educate everyone about it? <div>

<br></div><div style>the thing is floating point doesn't act like most other models of numbers, they have a very very non linear grid of precision across as HUGE dynamic range. Pretending theyre something they're not is the root of most problems with them. </div>

<div style><br></div><div style>either way, its a complex problem that nees to be carefully sorted out</div><div style><br></div><div style><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 14, 2014 at 3:03 AM, Sven Panne <span dir="ltr"><<a href="mailto:svenpanne@gmail.com" target="_blank">svenpanne@gmail.com</a>></span> wrote:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">... and let's not forget about such fun stuff as IEEE's -0, e.g.:<br>
<br>
   1/(-1 * 0)   =>   -Infinity<br>
   1/(0 + (-1 * 0))   =>   Infinity<br>
<br>
If we take the standpoint that Haskell's Float and Double types<br>
correspond to IEEE 754 floating point numbers, there is almost no<br>
mathematical equivalence which holds, and consequently almost all<br>
folding or other optimizations will be wrong. One can do all these<br>
things behind a flag (trading IEEE compatibility for better code), but<br>
this shouldn't be done by default IMHO.<br>
<div class="HOEnZb"><div class="h5">_______________________________________________<br>
ghc-devs mailing list<br>
<a href="mailto:ghc-devs@haskell.org">ghc-devs@haskell.org</a><br>
<a href="http://www.haskell.org/mailman/listinfo/ghc-devs" target="_blank">http://www.haskell.org/mailman/listinfo/ghc-devs</a><br>
</div></div></blockquote></div><br></div>