I'm gonna go out on a limb here and suggest that (a) this isn't quite the real code (since I see no newlines being printed), and (b) the real code is printing the return value of this subroutine, which will be a 1 from the print operator succeeding, and that's where the extra "1" is coming from after "2004".sub SBS_B2C{ my ($bin_date) = @_; my $year = 1900 + ($bin_date/365); print $year; #output 2004.41643835616 print int($year); #output 20041 } SBS_B2C(38112);
Let's see if my psychic powers are right on both cases. {grin}
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
In reply to •Re: int not working?
by merlyn
in thread int not working?
by Scarborough
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |