Name: jk109818 Date: 02/07/2002
FULL PRODUCT VERSION :
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.0-beta3-b84)
Java HotSpot(TM) 64-Bit Server VM (build 1.4.0-beta3-b84, mixed mode)
FULL OPERATING SYSTEM VERSION :SunOS unknown 5.8 Generic
sun4u sparc SUNW,Ultra-5_10
A DESCRIPTION OF THE PROBLEM :
The static method CubicCurve2D.solveCubic fails on cubics
that factor as (x - r)^2 * (x - s) where r and s are
real and distinct. It finds s but not r.
I looked at the source code and here is a 2 line fix:
change the line
if (R2 < Q3) {
to
if (R2 <= Q3 && Q != 0.0) {
and add the line
if (R2 == Q3) roots--;
just before the close of the above if.
Ralph Freese | E-Mail:
<mailto:###@###.###>
Department of Mathematics | WWW:
<http://www.math.hawaii.edu/~ralph>
University of Hawaii
Honolulu, Hawaii 96822
This bug can be reproduced always.
CUSTOMER WORKAROUND :
See description for a solution
(Review ID: 138582)
======================================================================