I am not a mathematician, and just started programming in javascript and wonders how 2.8 % 2 = 0.7999999999999998.
Note: I know it is remainder operation.
May be I forgot my school mathematics concepts. Can anyone please explain this?
Thanks.
2026-03-26 19:05:45.1774551945
can anyone please explain how 2.8 modulo 2 is 0.7999999999999998?
185 Views Asked by Bumbble Comm https://math.techqa.club/user/bumbble-comm/detail At
1
The floating point number 2.8 cannot be exactly represented in your Javascript floating point number: the binary64 IEEE double precision number is $$2.8 \rightarrow 2.79999999999999982236431605997495353221893310546875\dots$$