Message8595
The function sqrt from the math-module throws a "math domain error" for the argument "-1" but not for other negative values such as "-2". It should raise a "math domain error" for all negative arguments.
The "sqrt" function in math.java (Jython 2.7) should be changed to (note the "v < ZERO" instead of "v == MINUS_ONE"):
public static double sqrt(double v) {
if (isnan(v)) {
return v;
}
if (ispinf(v)) {
return v;
}
if (isninf(v) || v < ZERO) {
throwMathDomainValueError();
}
return Math.sqrt(v);
} |
|
Date |
User |
Action |
Args |
2014-06-03 09:39:49 | tkohn | set | messageid: <1401788389.96.0.911389979341.issue2159@psf.upfronthosting.co.za> |
2014-06-03 09:39:49 | tkohn | set | recipients:
+ tkohn |
2014-06-03 09:39:49 | tkohn | link | issue2159 messages |
2014-06-03 09:39:49 | tkohn | create | |
|