zserio
zserio copied to clipboard
Improve floats comparison in generated code
Although floats comparison in zserio expressions are forbidden, there are still floats comparisons in generated code in equality operator and in parameter check. Such float comparison in generated code in all languages is implemented by simple quality operator.
This should be changed to compare the absolute difference between the floats and minimum float number (epsilon). This will solve potential wrong float comparisons, e.g. (0.3 * 3) + 0.1
!= 1.0
.