summaryrefslogtreecommitdiff
path: root/libc/src/math/generic/sinhf.cpp
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2024-01-18 13:40:49 +0100
committerGitHub <noreply@github.com>2024-01-18 13:40:49 +0100
commit11ec512f444986c5cf09ad8b5c01a93063b21c4a (patch)
tree2d940fba82c0a5fbebfab202607e3d4937cae15d /libc/src/math/generic/sinhf.cpp
parent9acc4042300a92856527169b28c43cebf179d6d5 (diff)
[libc][NFC] Introduce a Sign type for FPBits (#78500)
Another patch is needed to cover `DyadicFloat` and `NormalFloat` constructors.
Diffstat (limited to 'libc/src/math/generic/sinhf.cpp')
-rw-r--r--libc/src/math/generic/sinhf.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/libc/src/math/generic/sinhf.cpp b/libc/src/math/generic/sinhf.cpp
index d64519d0ec79..b3850c674270 100644
--- a/libc/src/math/generic/sinhf.cpp
+++ b/libc/src/math/generic/sinhf.cpp
@@ -53,9 +53,8 @@ LLVM_LIBC_FUNCTION(float, sinhf, (float x)) {
if (xbits.is_inf())
return x;
- bool sign = xbits.get_sign();
int rounding = fputil::quick_get_round();
- if (sign) {
+ if (xbits.is_neg()) {
if (LIBC_UNLIKELY(rounding == FE_UPWARD || rounding == FE_TOWARDZERO))
return -FPBits::max_normal();
} else {
@@ -66,7 +65,7 @@ LLVM_LIBC_FUNCTION(float, sinhf, (float x)) {
fputil::set_errno_if_required(ERANGE);
fputil::raise_except_if_required(FE_OVERFLOW);
- return x + FPBits::inf(sign);
+ return x + FPBits::inf(xbits.sign());
}
// sinh(x) = (e^x - e^(-x)) / 2.