in reply to Percentage module in Math::?
I agree with most of the others. This is module madness if we need a module to do division.
I will ad this to what the others have said though. Be careful of divide by zero. You may want to do something like this.
And then check $percent for undef.my $percent = ($second_number ? $first_number/$second_number : undef);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Percentage module in Math::?
by ysth (Canon) on Dec 09, 2007 at 06:23 UTC | |
by syphilis (Archbishop) on Dec 09, 2007 at 06:45 UTC |