Use Benchmark:
cmpthese -1, { a=>q[ $sine = rand( 2 ) - 1; $cosine = sqrt( 1 - $sine**2 ); ], b=>q[ $angle = rand( 2 *3.14159 ); $sine = sin( $angle ); $cosine = cos( $angle ); ], };; Rate a b a 1614300/s -- -28% b 2246655/s 39% --
In reply to Re: computational efficiency
by BrowserUk
in thread computational efficiency
by thelycaeum
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |