Describe the bug

The commands INCRBYFLOAT and HINCRBYFLOAT have rounding errors on macOS but they work as expected on Linux.

To reproduce

> SET mykey 10.50

OK

> INCRBYFLOAT mykey 0.1

10.59999999999999964


> HSET mykey field 10.50

1

> HINCRBYFLOAT mykey field 0.1

10.59999999999999964

Expected behavior

> SET mykey 10.50

OK

> INCRBYFLOAT mykey 0.1

10.6


> HSET mykey field 10.50

1

> HINCRBYFLOAT mykey field 0.1

10.6

Additional information

I am using redis 7.2.1 and macOS 14 (arm64).

Comment From: oranagra

Floating point is not accurate and there are numbers that look very plain in decimal that it simply can't store. some platforms use 80 bit long double variables, others use less. there's nothing to do here, that's how floats work.