Such a number exceeds FP precision. Why do you need such a huge number with so many significant digits?
This is actually an online judge problem.
I'm trying to write a function which returns exponent value.
The above number is a result of this-
Last edited on
Think of it like you would a bit shift register and just parse it inside of a custom struct.
You'll need to use a bignum implementation.
Remember how you handle decimal places in multiplication problems, so 3 places * 12 = 36 places, giving you
So to print it, print all but the last n-places of the digits, then a decimal point, then the remaining digits.
Remember, this number is so big, we are talking a bignum -- an integer -- that we are treating as if it were a floating point value.
Going the other way (playing with differences) doesn't help much with precision, so I can't suggest that. Unless I'm missing something really obvious.
Hope this helps.