[ 
https://issues.apache.org/jira/browse/NUMBERS-195?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17742923#comment-17742923
 ] 

Gilles Sadowski commented on NUMBERS-195:
-----------------------------------------

{quote}[...] I have the same question for methods like StringUtils.isEmpty() 
and CollectionUtils.isEmpty() [...]
{quote}
It's not the same because
{code:java}
coll.isEmpty(){code}
and
{code:java}
coll.size() >= 0{code}
both involve a method call.

Method {{isBetween(x, a, b)}} does not improve readability (slightly the 
opposite IMHO).
It could even be error-prone since a "logical" order for arguments could be 
construed as {{{}isBetween(a, x, b){}}}.

Also, if we were to consider the syntactic sugar, this kind of checks should 
not be in {{ArithmeticUtils}} whose scope is (as per its Javadoc): "arithmetics 
related, additions to the built-in functions in [JDK's] Math [class]".

> New function - is number between 2 others
> -----------------------------------------
>
>                 Key: NUMBERS-195
>                 URL: https://issues.apache.org/jira/browse/NUMBERS-195
>             Project: Commons Numbers
>          Issue Type: New Feature
>          Components: core
>            Reporter: Dimitrios Efthymiou
>            Priority: Minor
>              Labels: features
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I propose a new function for ArithmeticUtils that takes 3 numbers and it 
> checks if the first argument is numerically between the other 2



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to