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)'.

Alternative would be: Math.abs(num) == Math.floor(num)

Cheers

Andreas

Reply via email to