mathiasvatter / cksp-compiler-issues

Issues-only repository of the ksp-compiler
0 stars 0 forks source link

Constant Folding gets Floats wrong #6

Closed mathiasvatter closed 7 months ago

mathiasvatter commented 8 months ago

Describe the bug Incorrect optimization of real numbers

To Reproduce

sli_dynamics := real_to_int(scale.range(80.0, 0.0, 127.0, 0.0, 1000000.0))

Actual Behaviour

$sli_dynamics := real_to_int(629921)

Expected Behaviour

$sli_dynamics := real_to_int(629921.2598425196)

CKSP Version v0.0.3

Environment (please complete the following information):