kdl-org / kdl

the kdl document language specifications
https://kdl.dev
Other
1.1k stars 61 forks source link

IEEE 754-2008 Decimal format #242

Closed danini-the-panini closed 2 years ago

danini-the-panini commented 2 years ago

I am implementing parsing for some of the reserved type annotations mentioned in the SPEC. See my PR here: https://github.com/danini-the-panini/kdl-rb/pull/6

I would like to know what a string representation of a IEEE 754-2008 decimal format look like, since I can't seem to find any examples. Similarly, I'm wondering what the expected outcome of using decimal64 and decimal128 on a float are, and whether that's something I should take into account for the Ruby implementation, considering Ruby doesn't have much in the way of different number types compared to something like rust.

danini-the-panini commented 2 years ago

This may have some overlap with #235

tabatkins commented 2 years ago

As far as I could tell from the paper, it should look identical like any other float: integer part, decimal part, exponent part. I just passed the characters straight to Python's decimal type.

Patitotective commented 1 year ago

@tabatkins Could you please tell in which specific page/section of the paper you found that? And what does identical like any other float means? Optional plus or minus sign at the beginning of the decimal? Is it also allowed after the e exponent? Are dots allowed at the end of a decimal 1.?