Day 41 | Daily Java interview question | #java #ocjp #scjp #javacertification

preview_player
Показать описание
Daily Java interview questions
Java programming interview questions
Java interview questions
Java tutorial
Java programming
learn Java
#scjp #javaprogramming #javainterviewquestion #javatutorial #learnjava #interview #javaquestions #javascript #ocjp #java #javacertification
Рекомендации по теме
Комментарии
Автор

In computers, floating point real numbers are represented in binary. However, not all numeric values ​​that implement floating point can be represented exactly in binary. This is like you can't express the forum key value 1/3 as a decimal (it would be 0.3333...and so on forever).

For example:

0.1 as binary is not exact, it is only approximate. When you multiply 0.1 (as an incorrect binary representation) by 2, the result approximates to 0.2, do that (0.1*2==0, 2) returns true.

However, when you multiply 0.1 (as an incorrect binary representation) by 3, the result is not precise enough to compare with 0.3, so (0.1*3==0.3) ) returns false.

fantasy_.
Автор

How bro
Pls can anyone explain it for me?

diwakarme
visit shbcf.ru