Skip to content
Prev 170070 / 398506 Next

How to handle large numbers?

Shouldn't it rather be 1 / exp(7), since exp(1007) = exp(1000) * exp(7)?

You can get the correct solution if you rewrite the fraction  
algebraically first, dividing all terms by exp(1000).

1 / (exp(7) + 5 * exp(-1000))

[1] 0.000911882

Of course, you have to know which of the numbers are large in order to  
do this right ...



Best regards,
Stefan Evert

[ stefan.evert at uos.de | http://purl.org/stefan.evert ]