Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val real = -1 * b / (2 * a)
- val imag = d / (2 * a)
- val root1
- val root2
- if (underR >= 0)
- {
- root1 = real + imag
- root2 = real - imag
- }
- else
- {
- if (imag < 0)
- {
- root1 = real + " - " + (-1 * imag) + "i"
- root2 = real + " + " + (-1 * imag) + "i"
- }
- else
- {
- root1 = real + " + " + imag + "i"
- root2 = real + " - " + (-1 * imag) + "i"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement