Open jt3k opened 8 years ago
i fixed this problem in the following way: before:
i = 8;
(1 - (i / 100)); // => 0.9299999999999999
after:
i = 8;
(100 - i) / 100; // => 0.92
also i fixed implementation of method "mix"
now is looks very simple
bump
Please see the comment at #124
OK thanks. I am currently a little busy. within a week I will add checks in tests
bump
It is the problem of storing floating point numbers in javascript
look at this line https://github.com/bgrins/TinyColor/blob/master/test/test.js#L724 here
(1 - (i / 100))
in this example if we assign "i" as 8, we get this result:but in real life
1 - 8/100 = 1 - 0.08 = 0.92
Tests are passed well, though contain this error.
Probably the same problem is present in the implementation of the mix method.