JavaChallenge38

Govinda Raj
wolfie/JavaChallenge
Sep 16, 2021

--

Try to solve the challenge by yourself first.

The answer should be 1 but that’s not the case the answer is 0.9999999999999999 . Let’s see the bytecode —

So, at compile time only all 0.1 will be added, but it’s weird; so many of you will get a question —

Is floating point math broken???

Please go through the following links, it will help you to understand the entire concept —

Thanks. Don’t forget to upvote.

--

--

Govinda Raj
wolfie/JavaChallenge

Senior Software Developer. Tech Enthusiast and love coding. My portfolio: https://govinda-raj.github.io/