<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Looks good to me.<div class=""><br class=""><div><blockquote type="cite" class=""><div class="">Iavor Diatchki <<a href="mailto:iavor.diatchki@gmail.com" class="">iavor.diatchki@gmail.com</a>>:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hello,<div class=""><br class=""></div><div class="">I was assigned to be the shepherd for the Hex Float proposal (<a href="https://github.com/ghc-proposals/ghc-proposals/pull/37" class="">https://github.com/ghc-proposals/ghc-proposals/pull/37</a>), so I would like to propose that we accept it for implementation in GHC.</div><div class=""><br class=""></div><div class="">This is a small change, which can be summarized as follows:</div><div class=""> - allow floating point numbers to be written using hex digits.</div><div class=""><br class=""></div><div class="">The format is exactly the same as decimal floating point numbers, except for:</div><div class=""> - the literals start with 0x</div><div class=""> - the digits are in hex</div><div class=""> - the exponent symbol is `p` or `P`, instead of `e` or `E`</div><div class=""> - the exponent is in base 2, rather than base 10</div><div class=""><br class=""></div><div class="">This notation has become popular among people working with floating point numbers, as the numbers you write can be represented exactly, which is not the case for base 10 numbers.</div><div class=""><br class=""></div><div class="">The following points were discussed:</div><div class=""> - the exact format to use, compared to what's allowed by other languages: we decided to just follow Haskell's decimal float notation, for least surprise</div><div class=""> - should overflow (which becomes `Inf`) result in a warning? We decided that this is an orthogonal issue, also relevant to decimal floating point and made a GHC ticket (#13232)</div><div class=""> - there is an odd interaction between floating point (both decimal and hex) and -XNegativeLiterals, related to negative 0, see ticket #13211</div><div class=""> - changing the Read instances for Float and Double to recognize hex floats could break some programs, although that does not seem all that likely</div><div class=""> - there is a question of how many extra pretty printing functions to add to `Numeric`: the current thinking is that maybe just one `showHFloat` is sufficient; the alternative is to add 5, mirroring the `show[E,F,G]Float` functions for decimals.</div><div class=""><br class=""></div><div class="">I also had a stab at implementing the basic notation here: <a href="https://phabricator.haskell.org/D3066" class="">https://phabricator.haskell.org/D3066</a></div><div class="">I haven't done the changes to the libraries yet.</div><div class=""><br class=""></div><div class="">Please let me know if you have any objections or suggestions on what might needs to be changed.</div><div class=""><br class=""></div><div class="">Cheers,</div><div class="">-Iavor</div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div><div class=""><br class=""></div></div>
_______________________________________________<br class="">ghc-steering-committee mailing list<br class=""><a href="mailto:ghc-steering-committee@haskell.org" class="">ghc-steering-committee@haskell.org</a><br class="">https://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-steering-committee<br class=""></div></blockquote></div><br class=""></div></body></html>