Lines Matching full:exponent

114 /* Return the value of a decimal exponent of the form
117 If the exponent overflows, returns a large exponent with the
127 assert(p != end && "Exponent has no digits"); in readExponent()
132 assert(p != end && "Exponent has no digits"); in readExponent()
136 assert(absExponent < 10U && "Invalid character in exponent"); in readExponent()
142 assert(value < 10U && "Invalid character in exponent"); in readExponent()
153 assert(p == end && "Invalid exponent in exponent"); in readExponent()
169 int exponent = 0; in totalExponent() local
171 assert(p != end && "Exponent has no digits"); in totalExponent()
176 assert(p != end && "Exponent has no digits"); in totalExponent()
185 assert(value < 10U && "Invalid character in exponent"); in totalExponent()
198 exponent = unsignedExponent; in totalExponent()
200 exponent = -exponent; in totalExponent()
201 exponent += exponentAdjustment; in totalExponent()
202 if (exponent > 32767 || exponent < -32768) in totalExponent()
207 exponent = negative ? -32768: 32767; in totalExponent()
209 return exponent; in totalExponent()
237 where the decimal point and exponent are optional, fill out the
238 structure D. Exponent is appropriate if the significand is
244 the return exponent is zero.
249 int exponent; member
261 D->exponent = 0; in interpretDecimal()
281 D->exponent = readExponent(p + 1, end); in interpretDecimal()
288 /* If number is all zeroes accept any exponent. */ in interpretDecimal()
300 D->exponent += static_cast<APFloat::ExponentType>((dot - p) - (dot > p)); in interpretDecimal()
301 D->normalizedExponent = (D->exponent + in interpretDecimal()
605 exponent = rhs.exponent; in assign()
697 exponent = rhs.exponent; in operator =()
707 return isFiniteNonZero() && (exponent == semantics->minExponent) && in isDenormal()
715 // denormal, i.e. the floating point number with exponent being minimum in isSmallest()
716 // exponent and significand bitwise equal to 1 (i.e. with MSB equal to 0). in isSmallest()
717 return isFiniteNonZero() && exponent == semantics->minExponent && in isSmallest()
768 // number with maximum exponent and with significand that is all ones. in isLargest()
769 return isFiniteNonZero() && exponent == semantics->maxExponent in isLargest()
793 if (isFiniteNonZero() && exponent != rhs.exponent) in bitwiseIsEqual()
805 exponent = ourSemantics.precision - 1; in APFloat()
915 assert(exponent == rhs.exponent); in addSignificand()
930 assert(exponent == rhs.exponent); in subtractSignificand()
971 exponent += rhs.exponent; in multiplySignificand()
982 // toward left by two bits, and adjust exponent accordingly. in multiplySignificand()
983 exponent += 2; in multiplySignificand()
1001 exponent -= (extendedPrecision - 1) - omsb; in multiplySignificand()
1039 // poision "2*precision - 1" to "precision - 1". The exponent need to be in multiplySignificand()
1041 exponent -= precision + 1; in multiplySignificand()
1057 exponent += bits; in multiplySignificand()
1098 exponent -= rhs.exponent; in divideSignificand()
1105 exponent += bit; in divideSignificand()
1112 exponent -= bit; in divideSignificand()
1120 exponent--; in divideSignificand()
1169 /* Our exponent should not overflow. */ in shiftSignificandRight()
1170 assert((ExponentType) (exponent + bits) >= exponent); in shiftSignificandRight()
1172 exponent += bits; in shiftSignificandRight()
1177 /* Shift the significand left BITS bits, subtract BITS from its exponent. */
1187 exponent -= bits; in shiftSignificandLeft()
1202 compare = exponent - rhs.exponent; in compareAbsoluteValue()
1234 exponent = semantics->maxExponent; in handleOverflow()
1293 /* Before rounding normalize the exponent of fcNormal numbers. */ in normalize()
1299 the exponent. */ in normalize()
1302 /* If the resulting exponent is too high, overflow according to in normalize()
1304 if (exponent + exponentChange > semantics->maxExponent) in normalize()
1307 /* Subnormal numbers have exponent minExponent, and their MSB in normalize()
1309 if (exponent + exponentChange < semantics->minExponent) in normalize()
1310 exponentChange = semantics->minExponent - exponent; in normalize()
1353 exponent = semantics->minExponent; in normalize()
1360 /* Renormalize by incrementing the exponent and shifting our in normalize()
1362 maximum exponent we overflow to infinity. */ in normalize()
1363 if (exponent == semantics->maxExponent) { in normalize()
1459 /* Are we bigger exponent-wise than the RHS? */ in addOrSubtractSignificand()
1460 bits = exponent - rhs.exponent; in addOrSubtractSignificand()
1873 // If the exponent is large enough, we know that this value is already in roundToIntegral()
1876 if (isFiniteNonZero() && exponent+1 >= (int)semanticsPrecision(*semantics)) in roundToIntegral()
2018 // has larger exponent range than the source semantics (this can happen in convert()
2020 // right shift could lose result mantissa bits. Adjust exponent instead in convert()
2024 if (exponent + exponentChange < toSemantics.minExponent) in convert()
2025 exponentChange = toSemantics.minExponent - exponent; in convert()
2030 exponent += exponentChange; in convert()
2128 if (exponent < 0) { in convertToSignExtendedInteger()
2131 /* For exponent -1 the integer bit represents .5, look at that. in convertToSignExtendedInteger()
2133 truncatedBits = semantics->precision -1U - exponent; in convertToSignExtendedInteger()
2135 /* We want the most significant (exponent + 1) bits; the rest are in convertToSignExtendedInteger()
2137 unsigned int bits = exponent + 1U; in convertToSignExtendedInteger()
2279 exponent = omsb - 1; in convertFromUnsignedParts()
2284 exponent = precision - 1; in convertFromUnsignedParts()
2364 exponent = 0; in convertFromHexadecimalString()
2404 /* Hex floats require an exponent but not a hexadecimal point. */ in convertFromHexadecimalString()
2405 assert(p != end && "Hex strings require an exponent"); in convertFromHexadecimalString()
2410 /* Ignore the exponent if we are zero. */ in convertFromHexadecimalString()
2418 /* Calculate the exponent adjustment implicit in the number of in convertFromHexadecimalString()
2430 /* Adjust for the given exponent. */ in convertFromHexadecimalString()
2431 exponent = totalExponent(p + 1, end, expAdjustment); in convertFromHexadecimalString()
2471 decSig.exponent += exp; in roundSignificandWithExponent()
2484 if (decSig.exponent < semantics->minExponent) { in roundSignificandWithExponent()
2485 excessPrecision += (semantics->minExponent - decSig.exponent); in roundSignificandWithExponent()
2490 /* Extra half-ulp lost in reciprocal of exponent. */ in roundSignificandWithExponent()
2509 /* Take the exponent of decSig. If we tcExtract-ed less bits in roundSignificandWithExponent()
2510 above we must adjust our exponent to compensate for the in roundSignificandWithExponent()
2512 exponent = (decSig.exponent + semantics->precision in roundSignificandWithExponent()
2555 // exponent, then we know that D.firstSigDigit will be non-numeric. in convertFromDecimalString()
2560 /* Check whether the normalized exponent is high enough to overflow in convertFromDecimalString()
2561 max during the log-rebasing in the max-exponent check below. */ in convertFromDecimalString()
2566 during the log-rebasing in the min-exponent check. Check that it in convertFromDecimalString()
2567 won't overflow min in either check, then perform the min-exponent in convertFromDecimalString()
2577 /* We can finally safely perform the max-exponent check. */ in convertFromDecimalString()
2632 D.exponent, rounding_mode); in convertFromDecimalString()
2705 The decimal exponent is always printed and has at least one digit.
2706 Zero values display an exponent of zero. Infinities and NaNs
2711 uses whatever is necessary so that the exponent is displayed as
2712 stored. This implies the exponent will fall within the IEEE format
2863 /* Finally output the exponent. */ in convertNormalToHexString()
2866 return writeSignedDecimal (dst, exponent); in convertNormalToHexString()
2876 // Normal floats need their exponent and significand hashed. in hash_value()
2878 Arg.semantics->precision, Arg.exponent, in hash_value()
2890 // Denormals have exponent minExponent in APFloat, but minExponent-1 in
2902 myexponent = exponent+16383; //bias in convertF80LongDoubleAPFloatToAPInt()
2985 myexponent = exponent+16383; //bias in convertQuadrupleAPFloatToAPInt()
3021 myexponent = exponent+1023; //bias in convertDoubleAPFloatToAPInt()
3051 myexponent = exponent+127; //bias in convertFloatAPFloatToAPInt()
3080 myexponent = exponent+15; //bias in convertHalfAPFloatToAPInt()
3147 /// exponent = all 1's, integer bit 0, significand 0 ("pseudoinfinity")
3148 /// exponent = all 1's, integer bit 0, significand nonzero ("pseudoNaN")
3149 /// exponent = 0, integer bit 1 ("pseudodenormal")
3150 /// exponent!=0 nor all 1's, integer bit 0 ("unnormal")
3166 // exponent, significand meaningless in initFromF80LongDoubleAPInt()
3169 // exponent, significand meaningless in initFromF80LongDoubleAPInt()
3172 // exponent meaningless in initFromF80LongDoubleAPInt()
3178 exponent = myexponent - 16383; in initFromF80LongDoubleAPInt()
3182 exponent = -16382; in initFromF80LongDoubleAPInt()
3228 // exponent, significand meaningless in initFromQuadrupleAPInt()
3232 // exponent, significand meaningless in initFromQuadrupleAPInt()
3236 // exponent meaningless in initFromQuadrupleAPInt()
3242 exponent = myexponent - 16383; in initFromQuadrupleAPInt()
3246 exponent = -16382; in initFromQuadrupleAPInt()
3265 // exponent, significand meaningless in initFromDoubleAPInt()
3268 // exponent, significand meaningless in initFromDoubleAPInt()
3271 // exponent meaningless in initFromDoubleAPInt()
3276 exponent = myexponent - 1023; in initFromDoubleAPInt()
3279 exponent = -1022; in initFromDoubleAPInt()
3298 // exponent, significand meaningless in initFromFloatAPInt()
3301 // exponent, significand meaningless in initFromFloatAPInt()
3304 // sign, exponent, significand meaningless in initFromFloatAPInt()
3309 exponent = myexponent - 127; //bias in initFromFloatAPInt()
3312 exponent = -126; in initFromFloatAPInt()
3331 // exponent, significand meaningless in initFromHalfAPInt()
3334 // exponent, significand meaningless in initFromHalfAPInt()
3337 // sign, exponent, significand meaningless in initFromHalfAPInt()
3342 exponent = myexponent - 15; //bias in initFromHalfAPInt()
3345 exponent = -14; in initFromHalfAPInt()
3404 // exponent = 1..10 in makeLargest()
3408 exponent = semantics->maxExponent; in makeLargest()
3429 // exponent = 0..0 in makeSmallest()
3433 exponent = semantics->minExponent; in makeSmallest()
3441 // exponent = 1..10 in getLargest()
3451 // exponent = 0..0 in getSmallest()
3463 // exponent = 0..0 in getSmallestNormalized()
3469 Val.exponent = Sem.minExponent; in getSmallestNormalized()
3601 // Decompose the number into an APInt and an exponent. in toString()
3602 int exp = exponent - ((int) semantics->precision - 1); in toString()
3625 // Change the exponent from 2^e to 10^e. in toString()
3853 exponent = 0; in next()
3861 exponent = semantics->maxExponent + 1; in next()
3869 // We only cross a binade boundary that requires adjusting the exponent in next()
3871 // 1. exponent != semantics->minExponent. This implies we are not in the in next()
3875 exponent != semantics->minExponent && isSignificandAllZeros(); in next()
3886 // must just adjust the exponent and set the integral bit to 1. in next()
3896 // 2. Decrement the exponent. in next()
3898 exponent--; in next()
3903 // We only cross a binade boundary that requires adjusting the exponent if in next()
3906 // the integral bit to 1, and increment the exponent. If we have a in next()
3908 // smallest normal binade have the same exponent in our representation. in next()
3915 assert(exponent != semantics->maxExponent && in next()
3916 "We can not increment an exponent beyond the maxExponent allowed" in next()
3918 exponent++; in next()
3937 exponent = semantics->maxExponent + 1; in makeInf()
3945 exponent = semantics->minExponent-1; in makeZero()
3962 return Arg.exponent; in ilogb()
3967 Normalized.exponent += SignificandBits; in ilogb()
3969 return Normalized.exponent - SignificandBits; in ilogb()
3976 // If Exp is wildly out-of-scale, simply adding it to X.exponent will in scalbn()
3979 // need to support is the difference between the largest possible exponent and in scalbn()
3980 // the normalized exponent of half the smallest denormal. in scalbn()
3986 X.exponent += std::min(std::max(Exp, -MaxIncrement - 1), MaxIncrement); in scalbn()