in reply to int not working?
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: •Re: int not working?
by ysth (Canon) on May 06, 2004 at 16:26 UTC | |
|
Re: •Re: int not working?
by Scarborough (Hermit) on May 06, 2004 at 15:55 UTC | |
|
Re: •Re: int not working?
by Scarborough (Hermit) on May 06, 2004 at 16:04 UTC |