Skip to content

Commit 78eb980

Browse files
committed
avoid mixed precision
1 parent dc3e101 commit 78eb980

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libc/src/math/generic/tanpif.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,8 @@ LLVM_LIBC_FUNCTION(float, tanpif, (float x)) {
9393
fputil::set_errno_if_required(EDOM);
9494
fputil::raise_except_if_required(FE_DIVBYZERO);
9595

96-
int32_t x_mp5_u = static_cast<int32_t>(x - 0.5);
97-
return ((x_mp5_u & 0x1) ? -1 : 1) * FPBits::inf().get_val();
96+
int32_t x_mp5_i = static_cast<int32_t>(xd - 0.5);
97+
return FPBits::inf((x_mp5_i & 0x1) ? Sign::NEG : Sign::POS).get_val();
9898
}
9999

100100
using fputil::multiply_add;

0 commit comments

Comments
 (0)