dmitrey schrieb:
> Hi all,
> I expected to have some speedup via using ldexp or multiplying an
> array by a power of 2 (doesn't it have to perform a simple shift of
> mantissa?), but I don't see the one.
>
> # Let me also note -
> # 1) using b = 2 * ones(N) or b = zeros(N) doesn't yield any speedup
> vs b = rand()
> # 2) using A * 2.0 (or mere 2) instead of 2.1 doesn't yield any
> speedup, despite it is exact integer power of 2.
>   
On recent processors multiplication is very fast and takes 1.5 clock 
cycles (float, double precision), independent of the values. There is 
very little gain by using bit shift operators.

Gregor
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to