Hi, I'm looking to do some error trapping for the quadratic equation.

How would put this into a while statement?

Here's the psudeocode

Thanks.Code:`while (sqrt is negative)`

println("The answer is imaginary")

Printable View

- 07-25-2007, 06:46 PMpaulHelp with quadratic equation in java
Hi, I'm looking to do some error trapping for the quadratic equation.

How would put this into a while statement?

Here's the psudeocode

Code:`while (sqrt is negative)`

println("The answer is imaginary")

- 07-25-2007, 09:23 PMSeemster
while (Math.sqrt(<some double value>) < 0) {

System.out.println("The square root is less than 0");

}