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

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

Thread Next
From:
Andrew Savige
Date:
March 11, 2005 18:47
Subject:
[Pugs] Should the int() function truncate or round?
Message ID:
20050312024724.59533.qmail@web50809.mail.yahoo.com
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?
If a feature, how does one truncate with Pugs/Perl6?

/-\


Find local movie times and trailers on Yahoo! Movies.
http://au.movies.yahoo.com

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