Open GoogleCodeExporter opened 8 years ago
looks like it might be related to #414 in the use of double precision
scanning/formatting.
Original comment by rich...@bucker.net
on 2 Aug 2011 at 3:47
It's sort of related.
In the case you offer, it's not that you are losing precision, it's that .4 can
not be represented exactly in binary (though 1.4 and .4 have differing
representations to the right of the decimal: 1.3999999999999999 and
0.40000000000000002 respectively). Your computer does it's best to represent
those values, but when formatting as base-10, it shows you really what it is
storing (as best it can). There are ways of showing you a "prettier"
representation of what it stored in such a way that you are less confused
(http://babbage.cs.qc.edu/IEEE-754/Decimal.html does as much), but those aren't
typically included as part of number formatting.
Regardless, both 20110802.399999999 and 20110802.4 are the same number in IEEE
754 FP double representation, even if it isn't pretty.
Original comment by josiah.c...@gmail.com
on 2 Aug 2011 at 6:19
I accept the explanation. but since I need the score to be entered by a
human. I need the score to be pretty.
Feel free to close the ticket or make it low priority.
/r
Original comment by rich...@bucker.net
on 2 Aug 2011 at 6:55
Has there been any progress on this issue? I can confirm that the issue is
still present.
Original comment by earl.oli...@gmail.com
on 6 Mar 2014 at 9:13
This Google Code project is outdated. Please file issues at the github
repository: https://github.com/antirez/redis.
With regard to this issue: There's no need for any progress. Scores are stored
as IEEE 754 floats as Josiah explained, so it's not a real issue anyway.
Original comment by jeredi...@gmail.com
on 6 Mar 2014 at 9:57
This isn't a bug with Redis, it's a bug with your understanding of how floating
point values work. Read https://code.google.com/p/redis/issues/detail?id=621#c2
.
Original comment by josiah.c...@gmail.com
on 6 Mar 2014 at 4:06
Original issue reported on code.google.com by
rich...@bucker.net
on 2 Aug 2011 at 3:43