Adding two integers vs. adding two floating-point numbers

According to the julia documents,

adding two integers is very different from adding two floating-point numbers, both of which are distinct from adding an integer to a floating-point number.

Is adding two integers faster than adding two floating-point numbers? This question should not be confined to julia.

it depends on your processor, but generally yes. for zen4, for example, integer adds have a latency of 1 cycle, while floating point adds have a latency of 3

7 Likes