Problem 6.2 (increment an arbitrary precision integer) issue?

#1

The problem asks to implement code to increment a decimal number D to D+1. The solution doesn’t apply to any decimal number, only decimal integers. Correct? And the problem is meant only for integers, not numbers?

If 129 meant 12.9 adding 1 with the given approach wouldn’t work. I think it was slightly confusing as terms such as finite-precision or precision arithmetic seem to be usually associated with floating point numbers, not integers.

1 Like

#2

Hi @googlejob,

I think 12.9 is not a good example because it is not an integer. In the problem description, I think the word usage of number is definitely confusing and I will change it to integer for sure.

0 Likes

#3

@tsunghsienlee
I was confused by this too, because of the mention of “finite-precision arithmetic”. What is the relevance of finite-precision arithmetic to the problem, if input can only be integers?

0 Likes

#4

Don’t over-interpret the line of fine-precision as it just explains you cannot rely on built-in big number library.

0 Likes

#5

Sounds good! Thanks.

0 Likes