develooper Front page | perl.perl5.porters | Postings from October 2003

Re: [perl #24091] Not OK: perl v5.8.1 on sgi6-irix-ld 6.5

From:
Yitzchak Scott-Thoennes
Date:
October 7, 2003 11:43
Subject:
Re: [perl #24091] Not OK: perl v5.8.1 on sgi6-irix-ld 6.5
Message ID:
20031007184209.GA2828@efn.org
On Tue, Oct 07, 2003 at 08:12:13PM +0200, Tels <perl_dummy@bloodgate.com> wrote:
> Oh, something fishy is going on:
> 
>       print $x->[0] ** (1 / $n->[0]), "\n";
>       $x->[0] = int( $x->[0] ** (1 / $n->[0]) );
>       print $x->[0],"\n";
> 
> This produces for $x == [ 81 **3 ] and $n == [3] the following output:
> 
> 	81
> 	80
> 
> Huh?!? This is with Perl v5.8.0...

$ perl -we'printf "%.16g\n", (81**3)**(1/3)'
80.99999999999999



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About