crertel / graphmath

An Elixir library for performing 2D and 3D mathematics.
The Unlicense
79 stars 14 forks source link

Round test failure on Elixir 1.4.1 #18

Closed cdegroot closed 5 years ago

cdegroot commented 7 years ago
   1) test round with 2 sigfigs (Graphmath.Mat33.Round_Mat33)
     test/mat33/mat33_round_test.exs:16
     Assertion with == failed
     code:  {1.1, 2.1, 3.1, 4.6, 5.7, 6.8, 7.0, 8.4, 10.0} == Graphmath.Mat33.round({1.14, 2.14, 3.14, 4.55, 5.66, 6.77, 7.03, 8.36, 9.99}, 1)
     left:  {1.1, 2.1, 3.1, 4.6, 5.7, 6.8, 7.0, 8.4, 10.0}
     right: {1.1, 2.1, 3.1, 4.5, 5.7, 6.8, 7.0, 8.4, 10.0}
     stacktrace:
       test/mat33/mat33_round_test.exs:17: (test)

Did something in the representation of floats maybe change that 4.54 is internally represented as 4.549....?

crertel commented 7 years ago

Wow, that's really bizarre. I'll look into that, thanks!

crertel commented 6 years ago

Confirmed. This is most certainly still a problem.

crertel commented 5 years ago

Fixed in most recent patch.