wc-duck / datalibrary

Open Source Data Library for data serialization.
Other
42 stars 8 forks source link

Add support for float as hex. #68

Closed wc-duck closed 6 years ago

wc-duck commented 6 years ago

I'm thinking about adding support for parsing floats from hex-numbers as well as decimal that is supported now.

The reason being precision. If one would like to specify floats precisely today it might not be possible! (See disabled unit test)

It would work as follows. If a float is parsed from hex it will just be read as an uint, or the bits of the float. Text would also always be unpacked as hex + comment, maybe controlled by flag?

'my_float' : 0x12345678 /0.2945/

lundmark commented 6 years ago

I think this is a very good thing in general for the parser. This is really something that I want for enums.

wc-duck commented 6 years ago

This will most certainly be closed by #88

wc-duck commented 6 years ago

Fixed by fixing issue #88