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

Gilles commented on MATH-1449:
------------------------------

bq. I didn't use Double.isInfinite() because I wanted to distinguish between 
positive and negative infinity.

I thought so.
Since these are unit tests, performance is not paramount, so I'd suggest to use 
2 assertions:
{code}
Assert.assertTrue(poly.getSize() > 0);
Assert.assertTrue(Double.isInfinite(poly.getSize()));
{code}
as they state different kinds of expectations.

bq. I disagree that the boolean statements read better

I guess that it's a matter of taste.
But if there is a shorter method, if it is customarily used and there is 
nothing against it (except taste), it is better to follow the same convention 
everywhere. And change what does not, when spotted.

I agree that these are nit-picks but they are in order to avoid subsequent 
"flip-flop" changes by people with different tastes. ;) Thanks for your 
understanding.

> PolygonsSet.getBarycenter() returns incorrect value for empty region
> --------------------------------------------------------------------
>
>                 Key: MATH-1449
>                 URL: https://issues.apache.org/jira/browse/MATH-1449
>             Project: Commons Math
>          Issue Type: Bug
>    Affects Versions: 4.0, 3.6
>            Reporter: Matt Juntunen
>            Priority: Major
>             Fix For: 4.0
>
>
> The o.a.c.m.geometry.euclidean.twod.PolygonsSet.getBarycenter() method 
> returns the point (0, 0) when the region is empty. It should return (NaN, 
> NaN) since the barycenter does not exist. This is the behavior of 
> IntervalsSet and PolyhedronsSet.
>  
> Pull request: https://github.com/apache/commons-math/pull/80



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to