Andreas Delmelle wrote:
> On Feb 11, 2008, at 11:23, Vincent Hennebert wrote:
> 
> Hi Vincent
> 
>> Hi Andreas,
>>
>>> Author: adelmelle
>>> Date: Sun Feb 10 05:01:07 2008
>>> New Revision: 620277
>> <snip/>
>>> +    private NumberProperty(double num) {
>>> +        //Store the number as an int or a long,
>>> +        //if possible
>>> +        if ((num >= 0 && num == Math.floor(num))
>>> +                || num == Math.ceil(num)) {
>>
>> Isn’t that the same as
>>     if (num == Math.floor(num))
> 
> Yes, for positive integers. For negative ints, it is 'num ==
> Math.ceil(num)'.

Err...
Math.floor(-2.0) == Math.ceil(-2.0) == Math.rint(-2.0) == -2.0

And same for a positive double. No need to make the distinction.

Vincent


-- 
Vincent Hennebert                            Anyware Technologies
http://people.apache.org/~vhennebert         http://www.anyware-tech.com
Apache FOP Committer                         FOP Development/Consulting

Reply via email to