AnotherRedisDesktopManager icon indicating copy to clipboard operation
AnotherRedisDesktopManager copied to clipboard

incr/decr返回的结果错误

Open jptangchina opened this issue 6 years ago • 1 comments

操作系统OS

MacOS Catalina 10.15.1

应用版本

1.2.5

问题描述

设置value为Long.MAX_VALUE左右的值,执行incr或decr返回的结果是错误的,但是控制台是正确的。测试发现当数字较小时没有此问题。 redis Info: 图片 操作截图: 图片 控制台正常截图: 图片

问题复现流程,操作截图等,建议把刚点开连接时展示的Redis Info信息页截图,方便查看Redis概况

jptangchina avatar Dec 11 '19 13:12 jptangchina

恭喜发现隐藏bug,应该是底层v8引擎关于float转化的问题

0x8000000000000800 should be 9223372036854777856, but V8 tells you that it's 9223372036854778000. That's because V8 uses double to represent a number that doesn't fit as smi, and 0x8000000000000800 certainly doesn't. Double has a limited precision of 53 bits mantissa, and 0x8000000000000800 would need 64 bits of mantissa to be exactly represented.

但只是显示异常而已,我又get了一下,结果是正常的 image

最后,话说你都MAX_VALUE了,你还incr decr干啥 😭

qishibo avatar Feb 18 '20 02:02 qishibo