How expensive is it to convert between int and double?
Here’s what I could dig up myself, for x86-64 doing FP math with SSE2 (not legacy x87 where changing the rounding mode for C++’s truncation semantics was expensive): When I take a look at the generated assembly from clang and gcc, it looks like the cast int to double, it boils down to one instruction: … Read more