inighthawki
Newcomer
- Joined
- Nov 29, 2005
- Messages
- 14
Im creating a set of useful functions, and one of them is to do the quadratic formula; however, if the result answer is imaginary, it returns NaN because it cant return imaginary numbers. My function normally returns a Double value, but what if u want it to return a string so it can display imaginary numbers? To do so i can code it to display (-B/2A) +- Sqrt(B^2 - 4AC) & "i" - simply put, but this is a string, and the function is a double. How can i make it so i can return both values? or do i have to make them all come back as strings?