Message8595

Author tkohn
Recipients tkohn
Date 2014-06-03.09:39:49
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1401788389.96.0.911389979341.issue2159@psf.upfronthosting.co.za>
In-reply-to
Content
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);
    }
History
Date User Action Args
2014-06-03 09:39:49tkohnsetmessageid: <1401788389.96.0.911389979341.issue2159@psf.upfronthosting.co.za>
2014-06-03 09:39:49tkohnsetrecipients: + tkohn
2014-06-03 09:39:49tkohnlinkissue2159 messages
2014-06-03 09:39:49tkohncreate