nnivruth commented on issue #495: LANG-1519 Add zero, positive & negative util 
methods
URL: https://github.com/apache/commons-lang/pull/495#issuecomment-615014953
 
 
   @garydgregory ,
   Been thinking and trying to make these functions more OO and rely on a 
single method but seeing some difficulties with type casting (esp for special 
types of number implementations - BigDecimal, etc), NaNs and custom Number 
implementations. 
   
   Some examples:
   
   - the isZero() function with the current impl does a direct equality check 
and returns true when passed with (-0.0d). IMO this is acceptable and correct 
but with the new impl it'll return false
   
   - the functions isZero(), isPositive(), isNegative() return false for 
float/double NaNs & vice versa for isNotZero(), isNotPositive(), 
isNotNegative() but with compare we might have to add special checks for these 
scenarios
   
   
   your thoughts/inputs on how to proceed?

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to