Hi GulfTube,Your caution is right: rounding
can wreck a digit count, so what you want is a test you can run
before you trust the shortcut, not after.
Start with what a digit count actually depends on:
which two powers of 10 the number sits between. A
14-digit number is anything from
10^13 up to just under
10^14. So the only real question is whether the rounding can shove you across one of those walls.
Step 1 - note which way the error goes.Replacing each
1024 with
1000 makes the number
smaller, so Bunuel's
16 x 10^12 is a
floor: the true n is at least that much. Written with a single leading digit, that floor is
1.6 x 10^13 - already
14 digits.
Step 2 - compare the error to the headroom.To gain a
15th digit, n would have to climb all the way to
10^14, which is
6.25x your floor. Now price the rounding: each swap costs a factor of
1024/1000 = 1.024, and there are
four of them, so
1.024^4 = 1.10 - about
10%. A
10% correction cannot cover a
6.25x gap, so
14 digits is locked in. (Exact value:
17,592,186,044,416 -
14 digits, as promised.)
That's the general test, and it's quick: write your estimate as
c x 10^k with c between
1 and
10, then ask whether the rounding error could push
c past
10 (or below
1). Here c moves
1.6 to
1.76. Nowhere near the wall. Even
ten such roundings would only inflate it about
27%.
Where the shortcut does break:Estimate
999^4 by rounding up to
1000^4 = 10^12, and it looks like
13 digits. But
999^4 = 996,005,996,001 - only
12. That estimate landed exactly
on a power of
10, so it had zero headroom, and a tiny error cost a whole digit.
Answer: CGulfTube
how did you recognize that 1024 can be safely estimated to be 1000 without having any issues in mis counting the total digits?
Bunuel