develooper Front page | perl.perl6.compiler | Postings from March 2005

Re: [Pugs] Should the int() function truncate or round?

Thread Previous | Thread Next
From:
Autrijus Tang
Date:
March 11, 2005 20:53
Subject:
Re: [Pugs] Should the int() function truncate or round?
Message ID:
20050312045522.GA8722@aut.dyndns.org
On Sat, Mar 12, 2005 at 01:47:24PM +1100, Andrew Savige wrote:
> Running this program with perl 5:
> 
> my $i = int(1.9);
> print "i=$i\n";
> 
> produces the answer 1 (i.e. it truncates) while running it with Pugs
> produces the answer 2 (i.e. it rounds).
> 
> Is this a bug or a feature?

It is a closed bug. :)  Day 43:

    http://use.perl.org/~autrijus/journal/23524

"The int primitive now properly truncates, instead of rounds, the operand."

6.0.11 will be out in a couple days that includes this fix.

Thanks,
/Autrijus/


Thread Previous | Thread Next


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