commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ori ziv (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (MATH-824) Algebra Utils
Date Sat, 14 Jul 2012 19:58:33 GMT

     [ https://issues.apache.org/jira/browse/MATH-824?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

ori ziv updated MATH-824:
-------------------------

    Attachment: AlgebraUtils.java

(prototype)
                
> Algebra Utils
> -------------
>
>                 Key: MATH-824
>                 URL: https://issues.apache.org/jira/browse/MATH-824
>             Project: Commons Math
>          Issue Type: New Feature
>            Reporter: ori ziv
>         Attachments: AlgebraUtils.java
>
>
> Is there a place here for basic but repeated methods such as:
> 	public static void verifyPositive(double number) {
> 		verifyBigger(number, 0, false);
> 	}
> 	public static void verifyTwoOrMore(double number) {
> 		verifyBigger(number, 2, true);
> 	}
> 	public static void verifyBigger(double number, double minimum,
> 			boolean isExactOK) {
> 		if (!isBigger(number, minimum, isExactOK)) {
> 			throw new IllegalArgumentException(number
> 					+ (isExactOK ? "<" : "<=") + minimum);
> 		}
> 	}
> 	public static boolean isBigger(double number, double minimum,
> 			boolean isExactOK) {
> 		return number > minimum || isExactOK && number == minimum;
> 	}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message