Comments

Very large numbers

Very large numbers

Look at these two numbers:

A = 279641170620168673833
B = 350247984153525417450

Which of the two is greater, A or B?

Solution

We cannot calculate the exact value of both numbers and compare them directly since they have too many digits to perform the calculations with our computer. Despite that, we can represent them in scientific notation.

We know that:
log (A) = 79641170620168673833log (2)
log (B) = 50247984153525417450log (3)

If we take the logarithm of 2 and 3, we multiply it by the exponent and divide it by the logarithm of 10, separating the whole part of the decimal part and use the decimal part to determine the first digits of the answer, we have to:
A = 5.0760252191 × 1023974381246463762439
B = 5.0760252191 × 1023974381246463762439

We see that using 10 decimal places both values ​​seem the same, which is impossible since A will be even and B will be odd. We need 20 decimal places to verify that B is slightly higher.

You can find more information (in English) on this page.