What is the sqrt(0)?
unfundedPeople succeed in answering Joel's questions 8% of the time (1 success in 13 attempts).
Answers by: YourTutorOnline | Caleb | gsch | nano | John | njones | StupidMonkey | vozcelik | Sergio Freire | Gary King | Joey | Adam Thorsen
Any orderth root of zero (including the square root) is zero.
But if you are fuzzy enough and define your own sqrt function that's your matter of taste then.
//pseudocode
function sqrt(int param)
{
if param is zero
throw new AreYouInsaneException("Zero is an unsquarerootable number, you moron!");
else
return Math.sqrt(param);
}
Cheers.