GeekInterview.com
Series: Subject: Topic:
Question: 5 of 38

Floating Point Numbers

Why in c++ (0.1 + 0.1) is not equal to 0.2 ??
Asked by: mehulgala177 | Member Since Sep-2011 | Asked on: Sep 23rd, 2011

View all questions by mehulgala177   View all answers by mehulgala177

Showing Answers 1 - 1 of 1 Answers
Sandhya.Kishan

Answered On : Mar 12th, 2012

View all answers by Sandhya.Kishan

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.

  
Login to rate this answer.

Give your answer:

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

Related Open Questions

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.