http://www.perlmonks.org?node_id=11121225


in reply to exp() bignum issue

What is your problem exactly, because Perl can usually handle this cases correctly.

At least, the following code works for me:

sub expit { my $x = shift; 1.0/(1.0 + exp(-$x)); }

Or do you really want to manage probabilities that are under the 1e-308 threshold, and that's why you need Math::BigFloat?