mirror of
https://github.com/UpsilonNumworks/Upsilon.git
synced 2026-03-20 14:20:39 +01:00
Emscripten converts C++ floats to doubles, which produces rounding errors. In the Graph application, when displaying y=sin(x), the ordinate '1' displayed "10" instead, because the exponent of 1000f was wrongly computed. To prevent this, we add the -s PRECISE_F32=1 flag, which uses 32-bits floating point values for floats. See https://kripken.github.io/emscripten-site/docs/getting_started/FAQ.html#why-do-i-get-odd-rounding-errors-when-using-float-variables