toolbox: Fix floating-point issues
math: Improve test suite