diff options
author | Guillaume Chatelet <gchatelet@google.com> | 2024-01-23 17:30:19 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-23 17:30:19 +0100 |
commit | 2856db0d3b691907e055265c10f3ccc9b04f594e (patch) | |
tree | e513ffb77746d6f5ba227d8c28874378eb9061e6 /libc/utils | |
parent | e1aa5b1fd12d548863cf73c1ec09f98fe89d117b (diff) | |
download | llvm-2856db0d3b691907e055265c10f3ccc9b04f594e.zip llvm-2856db0d3b691907e055265c10f3ccc9b04f594e.tar.gz llvm-2856db0d3b691907e055265c10f3ccc9b04f594e.tar.bz2 |
[libc][NFC] Remove `FPBits` cast operator (#79142)
The semantics for casting can range from "bitcast" (same representation)
to "different representation", to "type promotion". Here we remove the
cast operator and force usage of `get_val` as the only function to get
the floating point value, making the intent clearer and more consistent.
Diffstat (limited to 'libc/utils')
-rw-r--r-- | libc/utils/MPFRWrapper/MPFRUtils.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libc/utils/MPFRWrapper/MPFRUtils.cpp b/libc/utils/MPFRWrapper/MPFRUtils.cpp index 06a231c..7cc18cf 100644 --- a/libc/utils/MPFRWrapper/MPFRUtils.cpp +++ b/libc/utils/MPFRWrapper/MPFRUtils.cpp @@ -451,7 +451,7 @@ public: if (is_nan()) { if (FPBits<T>(input).is_nan()) return MPFRNumber(0.0); - return MPFRNumber(static_cast<T>(FPBits<T>::inf())); + return MPFRNumber(FPBits<T>::inf().get_val()); } int thisExponent = FPBits<T>(thisAsT).get_exponent(); |