Hi all
I am practicing with user defined functions and in this case I had to write my own sqrt function
I know that somehow I should take into account that user may input a negative number...but I dont know if I am supposed to tell the program to cout "nan"
Is "nan" compiler dependant or is it built in into the sqrt() function.
Hi and thank you for the reply...
I believe that if I set the condition to n <= 0 then the program would not work right because the sqrt() needs the number to be positive
that is my point...if the user input a negative number, the program should output "nan". This output depends from the compiler?