Do you know where your variables are? | |
PerlMonks |
Re^2: Answer: How do I round a number?by 5mi11er (Deacon) |
on Apr 27, 2005 at 18:19 UTC ( [id://452066]=note: print w/replies, xml ) | Need Help?? |
Wow, that's quite a scratchpad, thanks. So, I hadn't thought much about negative numbers. Is it mathematically correct for the ceiling function to go to the next more negative number (to the left on a number line) or to truncate (ie int) a negative number (move toward the right on a number line)? I think the rounding functions for negative numbers are correct (don't need adjusting), you're simply moving toward the nearest whole number... -Scott Update: As further discussed below, the code did originally have issues, the code in the answer above has now been replaced by working code.
In Section
Seekers of Perl Wisdom
|
|