|
Posted by sisyphus on February 12, 2008, 8:47 am
Please log in for more thread options > On Mon, 11 Feb 2008, Big and Blue wrote:
> > gamo wrote:
>
> > > PD: The n/m ratio seems to tend to 'e' number,
> > > which is not avaible from perl like pi
>
> > =A0 =A0e is available directly.
>
> > [mysys]: perl -le 'print exp(1)';
> > 2.71828182845905
>
> Ooops! That's rigth, e^1=3De
> My head was out of service.
>
> So, in the original problem the last sentence I could get is
>
> __END__
> 645 1749 ...
> 646 1752 n/m-e=3D-0.00620752505347248011
>
> and that's all... there are no more printouts =A0
>
> Thank you. Best regards,
>
>
>
> > --
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0Just because I've written it doesn't mean tha=
t
> > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 either you or I have to believe it.
>
> --http://www.telecable.es/personales/gamo/
> perl -E 'say 111_111_111**2;'
If you want to evaluate e to greater precision, I suggest (plug)
something like the following (which prints out a 10000-bit value of
e):
use warnings;
use strict;
use Math::MPFR qw(:mpfr);
my $precision =3D 10000; # bits
Rmpfr_set_default_prec($precision);
my $unity =3D Math::MPFR->new(1);
my $e =3D Math::MPFR->new();
Rmpfr_exp($e, $unity, GMP_RNDN);
print $e, "\n";
__END__
Cheers,
Rob
|