Is MOD operation more CPU intensive than multiplication?

后端 未结 5 765
一向
一向 2021-01-04 05:29

Why is MOD operation more expensive than multiplication by a bit more than a factor of 2? Please be more specific about how CPU perfor

5条回答
  •  青春惊慌失措
    2021-01-04 05:59

    Yes, mod is more expensive than multiplication, as it is implemented through division. (CPUs generally return both quotient and remainder on division.) But both of your threads use multiplication. copy/paste error?

提交回复
热议问题