Hi.

Cf. issue reported in
  https://issues.apache.org/jira/browse/MATH-1256

Quoting the OP:
---
In class Interval, which is in the package org.apache.commons.math4.geometry.euclidean.oned it is possible to pass the value for variable upper less than the value of variable lower, which is logically incorrect and also causes the method getSize() to return negative value
---

Is it ever necessary to allow negative intervals (e.g. wrt to "tolerance")?

If not, I propose to add a check in the constructor:
---CUT---
   if (upper < lower) {
throw new NumberIsTooSmallException(LocalizedFormats.ENDPOINTS_NOT_AN_INTERVAL,
                                           upper, lower, true);
   }
---CUT---

OK?

Regards,
Gilles


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to