47,7 → 47,7 |
return b; |
}; |
|
if (b.parts.exp==0xFF) { |
if (b.parts.exp == FLOAT32_MAX_EXPONENT) { |
return b; |
} |
|
59,12 → 59,12 |
} else { |
if (isFloat32NaN(a)) { |
//TODO: fix SigNaN |
if ((isFloat32SigNaN(a))||(isFloat32SigNaN(b))) { |
if (isFloat32SigNaN(a) || isFloat32SigNaN(b)) { |
}; |
return a; |
}; |
|
if (a.parts.exp==0xFF) { |
if (a.parts.exp == FLOAT32_MAX_EXPONENT) { |
return a; |
} |
|
99,7 → 99,7 |
mant1 <<= 6; |
mant2 <<= 6; |
|
if (expdiff > 24) { |
if (expdiff > (FLOAT32_MANTISA_SIZE + 1) ) { |
goto done; |
}; |
|
106,7 → 106,7 |
mant2>>=expdiff; |
mant1+=mant2; |
done: |
if (mant1 & (FLOAT32_HIDDEN_BIT_MASK << 6) ) { |
if (mant1 & (FLOAT32_HIDDEN_BIT_MASK << 7) ) { |
++exp1; |
mant1 >>= 1; |
}; |
114,7 → 114,7 |
/* rounding - if first bit after mantisa is set then round up */ |
mant1 += (0x1 << 5); |
|
if (mant1 & (FLOAT32_HIDDEN_BIT_MASK << 6)) { |
if (mant1 & (FLOAT32_HIDDEN_BIT_MASK << 7)) { |
++exp1; |
mant1 >> =1; |
}; |
145,7 → 145,7 |
}; |
|
/* b is infinity and a not */ |
if (b.parts.exp==0x8FF) { |
if (b.parts.exp == FLOAT64_MAX_EXPONENT ) { |
return b; |
} |
|
157,13 → 157,13 |
} else { |
if (isFloat64NaN(a)) { |
//TODO: fix SigNaN |
if ((isFloat64SigNaN(a))||(isFloat64SigNaN(b))) { |
if (isFloat64SigNaN(a) || isFloat64SigNaN(b)) { |
}; |
return a; |
}; |
|
/* a is infinity and b not */ |
if (a.parts.exp == 0x8FF) { |
if (a.parts.exp == FLOAT64_MAX_EXPONENT ) { |
return a; |
} |
|
200,7 → 200,7 |
mant1 <<= 6; |
mant2 <<= 6; |
|
if (expdiff > 53) { |
if (expdiff > (FLOAT64_MANTISA_SIZE + 1) ) { |
goto done; |
}; |
|
207,7 → 207,7 |
mant2 >>= expdiff; |
mant1 += mant2; |
done: |
if (mant1 & (FLOAT64_HIDDEN_BIT_MASK << 6) ) { |
if (mant1 & (FLOAT64_HIDDEN_BIT_MASK << 7) ) { |
++exp1; |
mant1 >>= 1; |
}; |
215,7 → 215,7 |
/* rounding - if first bit after mantisa is set then round up */ |
mant1 += (0x1 << 5); |
|
if (mant1 & (FLOAT64_HIDDEN_BIT_MASK << 6)) { |
if (mant1 & (FLOAT64_HIDDEN_BIT_MASK << 7)) { |
++exp1; |
mant1 >> =1; |
}; |
222,7 → 222,7 |
|
a.parts.exp = exp1; |
/*Clear hidden bit and shift */ |
a.parts.mantisa = ( (mant1 >>6 ) & (~ (FLOAT64_HIDDEN_BIT_MASK))); |
a.parts.mantisa = ( (mant1 >> 6 ) & (~FLOAT64_HIDDEN_BIT_MASK)); |
return a; |
} |
|