rustmatic icon indicating copy to clipboard operation
rustmatic copied to clipboard

Engineering floats

Open NOP0 opened this issue 5 years ago • 1 comments

I think I'm on thin ice and might need some mentoring here. Trying to implement "engineering floats" that is

3.14E-1 // 0.314

There's a lot of unwrapping going on, is this ok? The exponent is max u32, but I think that is large enough by the IEEE standard?

Another thing I see now, is that this rule might need to be over the float rule? (Most specific first?)

NOP0 avatar Dec 04 '19 11:12 NOP0

Redid this, tried in principle to do it like the different variants of Integer. What do you think?

Edit: I'm used to the convention asserteq(expected, actual), but in ast.rs it's used asserteq(got, should_be). Is it there any reason for this?

NOP0 avatar Dec 12 '19 13:12 NOP0