in reply to Re^2: Very basic question on performance
in thread Very basic question on performance
Or more accurately:
sub ediag { return abs($_[0]) * abs($_[1]); }
...or...
sub ediag { abs(shift) * abs(shift); }
It's possible (maybe even probable) that since the OP showed one subroutine that did this:
sub one { sqrt( $_[0] * $_[0] * $_[1] * $_[1] ) }
...and another that did this:
sub another{ sqrt( $_[0] * $_[0] + $_[1] * $_[1] ) }
...that we (I) should have been looking at his second example all along, and should have considered the first one a typo. If that's the case, then the square root of the sum of two squares does make more sense.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Very basic question on performance
by morrin (Acolyte) on Mar 14, 2014 at 15:28 UTC | |
|
Re^4: Very basic question on performance
by Laurent_R (Canon) on Mar 14, 2014 at 18:42 UTC | |
by davido (Cardinal) on Mar 14, 2014 at 18:57 UTC | |
by Laurent_R (Canon) on Mar 14, 2014 at 20:01 UTC |