Re: Constant divisions not converted to multiplications

Sebastian Galindo via Gcc <[email protected]>
Newsgroups gmane.comp.gcc.devel
Message-ID <[email protected]>
Hi,

Besides the fact that you can enable such optimization...

> Thus, I never cared of writing i.e
> float x = a * 0.1f
> but I always wrote
> float x = a / 10.f
> trusting the compiler.

This article look at this specific case: 
https://doi.org/10.1145/103162.103163 (Page 29, section 3.2.3), it's old 
but describe some interesting things about float numbers.
Therefore, in this example is better to use x = a / 10.f :-)

Best,
Sebastian
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.