Wayne Simmons wrote:

>>Int returns the integer portion --> it truncates!
> 
> Great, thanks for filling me in! So 6 truncates to 5 in perl?!? :-0
> 
> -Wayne

I think the easiest way to think of int() is that it returns the integer
portion of a floating point number (rounds towards zero).  int(5.1) will
return 5, and int(5.999) will return 5, because that's what's to the
left of the decimal.

As far as rounding numbers in Perl, it's a FAQ, and the answer can be
found here:

http://theoryx5.uwinnipeg.ca/CPAN/perl/pod/perlfaq4/Does_Perl_have_a_round()_function__What_.html

Cheers,

kjw
_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to