Why does 0.1 0.2 = 0.30000000000000004?
17-Feb-2023 770
I realized that I didn’t understand exactly how it worked. I mean, I know floating point calculations are inexact, and I know that you can’t exactly represent 0.1 in binary, but: there’s a floating point number that’s closer to 0.3 than 0.30000000000000004! So why do we get the answer 0.30000000000000004?.
Why does 0.1 0.2 = 0.30000000000000004? #ruby #rubydeveloper #rubyonrails #0.30000000000000004? https://rubyonrails.ba/link/why-does-0-1-0-2-0-30000000000000004