[APInt] Fix implicit truncation warning in bitsToFloat(). NFCI.

This commit is contained in:
Simon Pilgrim 2019-11-06 12:29:43 +00:00
parent 4fe94d0331
commit 63f08a59c8
1 changed files with 2 additions and 2 deletions

View File

@ -1727,13 +1727,13 @@ public:
return BitsToDouble(getWord(0));
}
/// Converts APInt bits to a double
/// Converts APInt bits to a float
///
/// The conversion does not do a translation from integer to float, it just
/// re-interprets the bits as a float. Note that it is valid to do this on
/// any bit width. Exactly 32 bits will be translated.
float bitsToFloat() const {
return BitsToFloat(getWord(0));
return BitsToFloat(static_cast<uint32_t>(getWord(0)));
}
/// Converts a double to APInt bits.