4 Comments
User's avatar
Aravind S's avatar

I'm doing 3rd year engineering where I'm studying data science... I'm learning things here that they would never teach in college... Daily dose of Data Science is awesome ❤️

Expand full comment
Joe Corliss's avatar

What about underflow? Could exp(-1000) be too small to represent?

Expand full comment
Avi Chawla's avatar

I have never experienced problems due to such cases, to be very honest.

Considering the range of exponent (0, inf), it's bounded on the lower side so libraries automatically consider the output to be zero when the input is too small. However, since there's no upper bound, that's where it gets problematic.

For instance, try doing:

- math.exp(-10000) -> 0

- math.exp(10000) -> overflow.

Expand full comment
S. K.'s avatar

Very easy to understand and superb explanation!

Expand full comment