in reply to Parameter validation for numeric function arguments?
Some factors to consider:
Should this function validate its input and warn/fail if a non-numeric value is provided? The built-in functions do not do this
Actually, they do.
>perl -wE"say sin('foo')" Argument "foo" isn't numeric in sin at -e line 1. 0 >perl -wE"say cos('3.1415bar')" Argument "3.1415bar" isn't numeric in cos at -e line 1. -0.999999995707656
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Parameter validation for numeric function arguments?
by janert (Sexton) on Aug 24, 2011 at 22:17 UTC |