Author: varioustoxins Date: Wed Nov 8 00:35:18 2006 New Revision: 2769 URL: http://svn.gna.org/viewcvs/relax?rev=2769&view=rev Log: ported r2768 (fix to bug #7641) commands used svn merge -r2767:2768 svn+ssh://varioustoxins@xxxxxxxxxxx/svn/relax/1.2 Modified: 1.3/float.py Modified: 1.3/float.py URL: http://svn.gna.org/viewcvs/relax/1.3/float.py?rev=2769&r1=2768&r2=2769&view=diff ============================================================================== --- 1.3/float.py (original) +++ 1.3/float.py Wed Nov 8 00:35:18 2006 @@ -154,7 +154,7 @@ if isFinite(float): # check and store is positive positive = isPositive(float) - if isZero(): + if isZero(float): if positive: result = CLASS_POS_ZERO else: @@ -178,7 +178,7 @@ result = CLASS_POS_INF elif isNegInf(float): result = CLASS_NEG_INF - + return result def packBytesAsPyFloat(bytes): @@ -612,16 +612,19 @@ # if exponent is not all ones this can't be a Inf if not isExpAllOnes(obj): result = False - - # get the mantissa as a byte array properly masked - manBytes = getMantissaBytes(obj) - - for byte in manBytes: - #check if any of the unmasked mantissa bytes are zero - # to be a NaN the mantissa must be zero - if byte > 0: - return False - return True + else: + # get the mantissa as a byte array properly masked + manBytes = getMantissaBytes(obj) + + for byte in manBytes: + #check if any of the unmasked mantissa bytes are zero + # to be a NaN the mantissa must be zero + if byte > 0: + result = False + break + result = True + + return result def isPosInf(obj): ''' check to see if a python float is positive infinity