merge with remote
[epclust.git] / data / preprocessing / convert_to_CSV.c
index 646c440..b3ff3be 100644 (file)
@@ -41,9 +41,10 @@ char readReal(FILE* stream, float* real)
        }
        if (curChar == 'e' || curChar == 'E')
                curChar = readInt(stream, &exponent);
-       *real = ( integerPart + (integerPart>0 ? 1. : -1.) * (float)fractionalPart
+       *real = ( integerPart + (integerPart>=0 ? 1. : -1.) * (float)fractionalPart
                / pow(10,countZeros+floor(log10(fractionalPart>0 ? fractionalPart : 1)+1)) )
                        * pow(10,exponent);
+
        return curChar; //separator or endline
 }