This does not do what you think it does, but it is at least close. You are really only doing if ($matrix[$i][$j] =~ /[^0.]/){ IE: does the string have at least one character that is not a literal '0' or a '.'
See: Bracketed Character Classes
Why not make the test if ($matrix[$i][$j] > 0)? That's much simpler and faster, and will not fail on "-0.00 " or " 0.00" or regular negative numbers.
In reply to Re^3: Calculate log of matrix values
by SuicideJunkie
in thread Calculate log of matrix values
by madM
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |