c++ practical computational complexity of <cmath> SQRT()
问题 What is the difference in CPU cycles (or, in essence, in 'speed') between x /= y; and #include <cmath> x = sqrt(y); EDIT: I know the operations aren't equivalent, I'm just arbitrarily proposing x /= y as a benchmark for x = sqrt(y) 回答1: The answer to your question depends on your target platform. Assuming you are using most common x86 cpus, I can give you this link http://instlatx64.atw.hu/ This is a collection of measured instruction latency (How long will it take to CPU to get result after