in reply to Perl oddities
I find the behaviour of int() odd: I want it to be like floor(), since then I can easily make ceil() and other useful functions for myself without loading the expensive POSIX module:
I've never been able to see a good reason for the existing "truncate towards zero" behaviour.sub ceil { -int(-shift) }
Hugo
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Perl oddities
by Roy Johnson (Monsignor) on Mar 01, 2005 at 18:21 UTC | |
by merlyn (Sage) on Mar 01, 2005 at 18:24 UTC | |
by TimToady (Parson) on Mar 01, 2005 at 19:02 UTC | |
by Roy Johnson (Monsignor) on Mar 01, 2005 at 18:46 UTC |