-
• #2
Heh, yes. Sorry - I was actually trying to fix this last night.
The artithmetic is absolutely fine - it's a bug in the float to string code. I was actually trying to fix this just yesterday, but I've added a bug for it to track it now: https://github.com/espruino/Espruino/issues/190
-
• #3
Thanks. I'll delve into the code myself some day so that I can help out in fixing these issues, but some day so far seems to have been a moving target ;).
As for the fix, I assume you'll just need to use some threshold when converting floating points as you will never get a perfect mapping. I have some code that I wrote a while back for a similar issue, but I'll have to dig it up though ...
-
• #4
Hi Kim,
Yes, I thought I'd used a threshold - but it turns out to be slightly more tricky than that (or I'm doing something very wrong!).
-
• #5
Seems to be fixe with 1.46 :). Do you collect any release notes on new versions?
-
• #6
Great! Info here:
http://www.espruino.com/ChangeLog
Yes, that is one of the things I fixed. It's not perfect IMO but it's an awful lot better :)
The result of Math.wrap(4,3) is 0.A. I assume this is a floating point bug of some sort?