% Test the speed of division versus multiplication
N=1000000;
repeat=100;
a=1:N; a=rand(1,N);
d=zeros(1,N);
m=zeros(1,N);

% Uses division
tic;
for i=1:repeat
    d=a/pi;
end
toc;

% Uses multiplication instead of division
tic;
inversePi=1/pi;
for i=1:repeat
    m=a*inversePi;
end
toc;
max(abs(d-m)),