Scarborough has asked for the wisdom of the Perl Monks concerning the following question:
My understanding of int is that it should return 2004 in this case. I tried to look up int on perldocs but the sites out reach at the moment.sub SBS_B2C{ my ($bin_date) = @_; my $year = 1900 + ($bin_date/365); #amended with ."\n" after merlyn's comments print $year."\n"; #output 2004.41643835616 print int($year); #output 20041 } SBS_B2C(38112);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
•Re: int not working?
by merlyn (Sage) on May 06, 2004 at 15:35 UTC | |
by ysth (Canon) on May 06, 2004 at 16:26 UTC | |
by Scarborough (Hermit) on May 06, 2004 at 15:55 UTC | |
by Scarborough (Hermit) on May 06, 2004 at 16:04 UTC |