I have a method which calculates the square root of only negative numbers
(which is sqrt(x)=sqrt(-x) +"*i"
, where x is a double
and "*i"
is a string)
the problem I have is that this method returns a double and a string which are two different variable types, so the question is how do I make this method return both?:
public static **(what goes here?)** myFunction(double x){
return(sqrt(x)+"*i");
}
this code is wrong but I do not know how to fix it, any tips?