Lines Matching refs:sign
81 * \param sign Sign. Must be +1/-1
96 static inline Float construct (int sign, int exponent, StorageType mantissa);
100 * \param sign Sign. Must be +1/-1
107 * The sign is turned into a sign bit and the exponent bias is added.
111 static Float constructBits (int sign, int exponent, StorageType mantissaBits);
121 inline int sign (void) const { return signBit() ? -1 : 1; }
132 static Float zero (int sign);
133 static Float inf (int sign);
136 static Float largestNormal (int sign);
137 static Float smallestNormal (int sign);
199 inline Float<StorageType, ExponentBits, MantissaBits, ExponentBias, Flags> Float<StorageType, ExponentBits, MantissaBits, ExponentBias, Flags>::zero (int sign)
201 DE_ASSERT(sign == 1 || ((Flags & FLOAT_HAS_SIGN) && sign == -1));
202 return Float(StorageType((sign > 0 ? 0ull : 1ull) << (ExponentBits+MantissaBits)));
206 inline Float<StorageType, ExponentBits, MantissaBits, ExponentBias, Flags> Float<StorageType, ExponentBits, MantissaBits, ExponentBias, Flags>::inf (int sign)
208 DE_ASSERT(sign == 1 || ((Flags & FLOAT_HAS_SIGN) && sign == -1));
209 return Float(StorageType(((sign > 0 ? 0ull : 1ull) << (ExponentBits+MantissaBits)) | (((1ull<<ExponentBits)-1) << MantissaBits)));
219 inline Float<StorageType, ExponentBits, MantissaBits, ExponentBias, Flags> Float<StorageType, ExponentBits, MantissaBits, ExponentBias, Flags>::largestNormal (int sign)
221 DE_ASSERT(sign == 1 || ((Flags & FLOAT_HAS_SIGN) && sign == -1));
222 return Float<StorageType, ExponentBits, MantissaBits, ExponentBias, Flags>::construct(sign, ExponentBias, (static_cast<StorageType>(1) << (MantissaBits + 1)) - 1);
226 inline Float<StorageType, ExponentBits, MantissaBits, ExponentBias, Flags> Float<StorageType, ExponentBits, MantissaBits, ExponentBias, Flags>::smallestNormal (int sign)
228 DE_ASSERT(sign == 1 || ((Flags & FLOAT_HAS_SIGN) && sign == -1));
229 return Float<StorageType, ExponentBits, MantissaBits, ExponentBias, Flags>::construct(sign, 1 - ExponentBias, (static_cast<StorageType>(1) << MantissaBits));
235 (int sign, int exponent, StorageType mantissa)
243 const StorageType s = StorageType((StorageType(sign < 0 ? 1 : 0)) << (StorageType(ExponentBits+MantissaBits)));
246 DE_ASSERT(sign == +1 || sign == -1);
256 (int sign, int exponent, StorageType mantissaBits)
258 const StorageType signBit = static_cast<StorageType>(sign < 0 ? 1 : 0);
261 DE_ASSERT(sign == +1 || sign == -1 );
274 if (!(Flags & FLOAT_HAS_SIGN) && other.sign() < 0)
282 return inf(other.sign());
292 return zero(other.sign());
298 const StorageType s = StorageType((StorageType(other.signBit())) << (StorageType(ExponentBits+MantissaBits))); // \note Not sign, but sign bit.
328 if (lastBits != 0ull && other.sign() < 0)
336 if (lastBits != 0ull && other.sign() > 0)
351 return zero(other.sign());
374 if (lastBits != 0ull && other.sign() < 0)
382 if (lastBits != 0ull && other.sign() > 0)
413 return (((other.sign() < 0 && rd == ROUND_UPWARD) || (other.sign() > 0 && rd == ROUND_DOWNWARD)) ? largestNormal(other.sign()) : inf(other.sign()));