Floating Point Numbers

Why in c++ (0.1 + 0.1) is not equal to 0.2 ??

Questions by mehulgala177   answers by mehulgala177

Showing Answers 1 - 2 of 2 Answers

The floating-point arithmetic in most computer languages is based on binary fractions (1/2, 1/4, 1/8, 1/16, ...) and not decimal fractions (1/10, 1/100, 1/1000, 1/1000,...)there is no ActionScript Number that is exactly equal to 0.1 because it require an infinite number of binary fractional bits.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions