File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ LIBC_INLINE T find_leading_one(T mant, int &shift_length) {
3030 if (mant > 0 ) {
3131 shift_length = (sizeof (mant) * 8 ) - 1 - cpp::countl_zero (mant);
3232 }
33- return T ( 1 ) << shift_length;
33+ return (T)( T ( 1 ) << shift_length) ;
3434}
3535
3636} // namespace internal
@@ -207,8 +207,8 @@ LIBC_INLINE T hypot(T x, T y) {
207207
208208 for (StorageType current_bit = leading_one >> 1 ; current_bit;
209209 current_bit >>= 1 ) {
210- r = (r << 1 ) + ((tail_bits & current_bit) ? 1 : 0 );
211- StorageType tmp = (y_new << 1 ) + current_bit; // 2*y_new(n - 1) + 2^(-n)
210+ r = (StorageType)( r << 1 ) + ((tail_bits & current_bit) ? 1 : 0 );
211+ StorageType tmp = (StorageType)( y_new << 1 ) + current_bit; // 2*y_new(n - 1) + 2^(-n)
212212 if (r >= tmp) {
213213 r -= tmp;
214214 y_new += current_bit;
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ struct Hypotf16Checker : public virtual LIBC_NAMESPACE::testing::Test {
3232 uint16_t ybits = xbits;
3333 do {
3434 float16 y = FPBits (ybits).get_val ();
35- bool correct = TEST_FP_EQ (LIBC_NAMESPACE::fputil::hypot (x, y),
35+ bool correct = TEST_FP_EQ (LIBC_NAMESPACE::fputil::hypot<float16> (x, y),
3636 LIBC_NAMESPACE::hypotf16 (x, y));
3737 // Using MPFR will be much slower.
3838 // mpfr::BinaryInput<float16> input{x, y};
You can’t perform that action at this time.
0 commit comments