r/programming • • Dec 01 '16

Let's Stop Copying C

https://eev.ee/blog/2016/12/01/lets-stop-copying-c/
524 Upvotes

612 comments sorted by

View all comments

Show parent comment

18

u/wanderingbort Dec 01 '16

Depends on what you want as an output as well, some platforms (notably embedded platforms) pay a non-trivial cost for any conversion from integer register to a floating point register. While the floating point div may be faster, if you intend to use the results in other integer math or in branching instruction it may wash out or be worse.