Compute the sum in java floating point


Discuss the below:

Q: In real arithmetic, the sum of the inverses of all positive integers goes to infinity. In other words, if we take enough terms in the sum the sum exceeds any fixed value.

Though, when we compute the sum in Java's floating point arithmetic the largest value we get is 15.403683, regardless of how many terms we add. Explain the possible reasons for this anomaly.

Solution Preview :

Prepared by a verified Expert
JAVA Programming: Compute the sum in java floating point
Reference No:- TGS01935931

Now Priced at $20 (50% Discount)

Recommended (99%)

Rated (4.3/5)