I understood. The problem was in brackets.
Should be
result1 = ( (-getB() + sqrt(discr)) / (2.0*getA()) );
result2 = ( (-getB() - sqrt(discr)) / (2.0*getA()) );
Type: Posts; User: Snouman
I understood. The problem was in brackets.
Should be
result1 = ( (-getB() + sqrt(discr)) / (2.0*getA()) );
result2 = ( (-getB() - sqrt(discr)) / (2.0*getA()) );
With many other equations work, BUT with this one NOT.
Have no idea why )
Result shoud be -0.5 and -1/3(in double)
BUT console shows me -18.0 and -12.0
Here my class
package task1;