incorrect result with Math.wrap() #190
Replies: 5 comments
-
Posted at 2014-01-23 by @gfwilliams 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: espruino/Espruino#190 |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-01-23 by Kim 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 ... |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-01-23 by @gfwilliams 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!). |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-01-24 by Kim Seems to be fixe with 1.46 :). Do you collect any release notes on new versions? |
Beta Was this translation helpful? Give feedback.
-
Posted at 2014-01-24 by @gfwilliams 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 :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Posted at 2014-01-22 by Kim
The result of Math.wrap(4,3) is 0.A. I assume this is a floating point bug of some sort?
Beta Was this translation helpful? Give feedback.
All reactions