Describe the bug
HINCRBYFLOAT return different results on different platforms.
To reproduce Following https://redis.io/commands/hincrbyfloat
ARM 32bit arch:
127.0.0.1:6379> HSET mykey field 10.50
(integer) 1
127.0.0.1:6379> HINCRBYFLOAT mykey field 0.1
"10.59999999999999964"
while ARM 64bit, x86_64, i586, PPC64LE:
127.0.0.1:6379> HSET mykey field 10.50
(integer) 1
127.0.0.1:6379> HINCRBYFLOAT mykey field 0.1
"10.6"
Expected behavior I expect that all the representations would be the same on all supported arches.
Additional information
127.0.0.1:6379> info
# Server
redis_version:6.0.8
redis_git_sha1:00000000
redis_git_dirty:0
redis_build_id:f90de2fc9727c7fa
redis_mode:standalone
os:Linux 4.19.128-lts-alt1 armv8l
arch_bits:32
multiplexing_api:epoll
atomicvar_api:atomic-builtin
gcc_version:9.3.1
process_id:2978876
run_id:579e6409cac0f684ce2c0f4d8f2fdf2078e2f2c6
tcp_port:6379
uptime_in_seconds:3116
uptime_in_days:0
hz:10
configured_hz:10
lru_clock:9426086
executable:/usr/sbin/redis-server
config_file:
io_threads_active:0
Comment From: oranagra
Redis is using long double, which on most platforms is implemented as 80-bit Extended precision. But this isn't mandatory by the spec, and some architectures (e.g. 32 bit ARM and a few others) simply use it as a synonym for double (64-bit).
Comment From: madolson
Looks resolved