Skip to content

Draft: #16216: Add readHexFloat to Numeric

toonn requested to merge toonn/ghc:wip/16216 into master

I'm working on #16216. The patch is still rough, there's a lot of duplication because that was easiest to get right. I wanted to know whether I'm on the right track. The feature being implemented is related to the HexFloatLiterals extension so I'm not 100% sure Numeric's the right place.

I tried to adhere as close as possible to the wording in the proposal as to what forms are parsed properly, for example the part of the mantissa before the floating point can be omitted 0x.5 is parsed as a hexadecimal float. This differs from the behavior of readFloat which does not allow this omission.

This is my first contribution to GHC so I'm sure there's plenty to improve. Feel free to criticize both the contents of the patch as well as practical matters such as branch naming or commit messages.

Edited by Carter Schonwald

Merge request reports