KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I've often noticed gcc converting multiplications into shifts in the executable. Something similar might happen when multiplying an int and a float . For example, 2 * f , might simply increment the exponent of f by 1, saving some cycles. Do the compilers, perhaps if one requests them to do so (e.g. via -ffast-math ), in general, do it? Are compilers generally smart enough to do this, or do I need to do this myself using the scalb*() or ldexp()/frexp() function family?
Tags (comma-separated)
Save Edits
Cancel