<p dir="ltr">That is right for positive integers. But for floating point numbers ?</p>
<p dir="ltr">Cheers, Raoul</p>
<div class="gmail_quote">Le 19 janv. 2014 21:23, "Philippe" <<a href="mailto:philippe@quarta.com.br">philippe@quarta.com.br</a>> a écrit :<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<u></u>
<div>
<p>forgot</p>
<p>X shl 1</p>
<p>normaly the fastest ...</p>
<p> </p>
<p>Em 19.01.2014 17:47, Ched escreveu:</p>
<blockquote type="cite" style="padding-left:5px;border-left:#1010ff 2px solid;margin-left:5px;width:100%">
<pre>Dear Freepascalers,

The multiplication in floating arthmetic units is usualy know as being slower than the addition. So, have 
I interest to code X+X, 2*X or X*2 when using reals (mainly double and extended) ?And with integers ?

Can the compiler optimise this operation choosing the fastest one - probably depending on the 
architecture x86, arm, aso.

Cheers, Raoul
_______________________________________________
fpc-pascal maillist  -  <a href="mailto:fpc-pascal@lists.freepascal.org" target="_blank">fpc-pascal@lists.freepascal.org</a>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a>
</pre>
</blockquote>
<p> </p>
</div>
<br>_______________________________________________<br>
fpc-pascal maillist  -  <a href="mailto:fpc-pascal@lists.freepascal.org">fpc-pascal@lists.freepascal.org</a><br>
<a href="http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal" target="_blank">http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal</a><br></blockquote></div>