1

This is for a homework assignment about floats and doubles, we are to add 1/1 + 1/2 + 1/3 ... up to 1/10,000,000 and to do it again from 1/10,000,000 back down to 1/1 and to print both answers as doubles and floats. I had no problems with this but both the floats were different numbers with the 1/1 starting float being vastly different and both doubles being the same. I'm just wondering why this is the case and could find little relevant information.

4

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.