127.0.0.1:6379 [2] & gt; INCRBYFLOAT amount 500
"500"
127.0.0.1:6379 [2] & gt; INCRBYFLOAT amount 2.1
"502.10000000000000001"
127.0.0.1:6379 [2] & gt; INCRBYFLOAT amount 0.3
"502.39999999999999999"
Some data don't have a problem, some can lead to many decimal places, looks like is greater than 150 will have this kind of problem? !

CodePudding user response:
Due to floating-point calculation accuracy problem in the redis, will lead to such problems, and not be able to avoid aSolution: suggest need to confirm the accuracy of the zoom multiples with integer incr series accordingly