Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

ofc, but it is possible for compiler to be smart enough to"discover" this? and use similar heuristics for other similar problems?


In 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.


No (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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: