Original Post
Hi, I've recently been attending job interview for positions in the games industry. In a recent interview I mentioned to the interviewer that I was never explicitly taught that the square root function was slow, it was just something I picked up. He then stopped me and told me that nowadays this is not the case, and hasn't been for a long time. He said that nowadays with optimisations and so forth that the operation is scarcely more expensive than a division. However only a few months ago I attended an interview where I was asked to make some code more efficient, and the answer they were looking for was to remove the square root. So who is right? Google tells me that people still seem to worry about sqrt being slow, as the first few hits are all 'faster methods for finding sqrt()'. Additionally, if it's an iterative technique you're only going to be able to make it so much faster (and certainly it's speed couldn't be converging on a division, if it requires one or more divisions per cycle). I'd really appreciate if someone in the know could help me out here. I'm leaning towards thinking this guy is wrong, but I don't see how someone in his position could be so wrong about something that is fairly elementary.