Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
-
None
-
Operating System: other
Platform: All
-
35434
Description
The constructor for Fraction fails for doubles which are almost integer.
examples should be inserted in th etest case:
public void testConstructorDouble() {
try
catch (ConvergenceException ex)
{ fail(ex.getMessage()); }}
The fix for this problem is to include the following code in the constructor:
int n = 0;
boolean stop = false;
// check for (almost) integer arguments, which should not go
// to iterations.
if (Math.abs(a0 - value)<epsilon)
do {
++n;