summaryrefslogtreecommitdiff
path: root/libc/src/math/generic/acoshf.cpp
diff options
context:
space:
mode:
authorGuillaume Chatelet <gchatelet@google.com>2024-02-13 11:17:28 +0100
committerGitHub <noreply@github.com>2024-02-13 11:17:28 +0100
commitf506192c016fb6909eb2c17e183f6223db012f8c (patch)
tree6b3a9c3cb07152f54422fff6e00ea29a5ed54296 /libc/src/math/generic/acoshf.cpp
parent8c6e96d9eb35849762fa3ab4d3cc9517c4e14e74 (diff)
[libc][NFC] Small `abs` related simplifications (#79858)
Diffstat (limited to 'libc/src/math/generic/acoshf.cpp')
-rw-r--r--libc/src/math/generic/acoshf.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/libc/src/math/generic/acoshf.cpp b/libc/src/math/generic/acoshf.cpp
index 54b66bf42fc6..a4a75a7b0438 100644
--- a/libc/src/math/generic/acoshf.cpp
+++ b/libc/src/math/generic/acoshf.cpp
@@ -33,12 +33,8 @@ LLVM_LIBC_FUNCTION(float, acoshf, (float x)) {
}
if (LIBC_UNLIKELY(x_u >= 0x4f8ffb03)) {
- // Check for exceptional values.
- uint32_t x_abs = xbits.abs().uintval();
- if (LIBC_UNLIKELY(x_abs >= 0x7f80'0000U)) {
- // x is +inf or NaN.
+ if (LIBC_UNLIKELY(xbits.is_inf_or_nan()))
return x;
- }
// Helper functions to set results for exceptional cases.
auto round_result_slightly_down = [](float r) -> float {