Converting a double into a String

I am creating a program where the user inputs a value and it calculates the log10 value of the input. But I need to make it so that if they input a negative value it will come out as undefine. How would I go abouts doing this would I need to type cast the double into a String so it can print out undefine or is there some other way I could do this?
Um...

1
2
if (value<0)cout << "undefined" << endl;
else cout << log10(value) << endl;
Topic archived. No new replies allowed.