3 ms·
ofc, but it is possible for compiler to be smart enough to"discover" this? and use similar heuristics for other similar problems?
by ltr_ 7y ago
ofc, but it is possible for compiler to be smart enough to"discover" this? and use similar heuristics for other similar problems?
- jacobolus 7y agoIn this particular case, it would not be useful. Personally I don’t ever want a compiler trying to replace straight-forward integer algorithms with floating point formulas. YMMV.
- mkl 7y agoNo (and no time soon unless it's a special case coded in manually), but some simpler things are possible, see e.g. https://news.ycombinator.com/item?id=16259157 https://news.ycombinator.com/item?id=16259157.