in reply to Re^4: Very basic question on performance
in thread Very basic question on performance
Yes, I'll agree. With that in mind, and given another followup from the OP, it seems that what he really wants is this:
sub diag { sqrt( $_[0]^^2 + $_[1]^^2 ); }
...or possibly...
sub diag { sqrt( shift^^2 + shift^^2 ); # Not sure if this is more readable, or + not. }
Or if he's in a really tight loop where every cycle counts, possibly an Inline::C version of the same.
Dave
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: Very basic question on performance
by Laurent_R (Canon) on Mar 14, 2014 at 20:01 UTC |