From 374221eefb7c4ba7b4489ed075222f6c247b3b91 Mon Sep 17 00:00:00 2001 From: Chip Hogg Date: Mon, 22 Jul 2024 10:12:08 -0400 Subject: [PATCH] Explicitly static cast to long double (#267) This fixes a very verbose warning that I noticed when installing the library in a Visual Studio project on Windows. And it just seems like a clearly good change for its own sake, anyway. --- au/code/au/magnitude.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au/code/au/magnitude.hh b/au/code/au/magnitude.hh index 1be7957e..f93e3cbd 100644 --- a/au/code/au/magnitude.hh +++ b/au/code/au/magnitude.hh @@ -378,7 +378,7 @@ constexpr MagRepresentationOrError root(T x, std::uintmax_t n) { // Always use `long double` for intermediate computations. We don't ever expect people to be // calling this at runtime, so we want maximum accuracy. long double lo = 1.0; - long double hi = x; + long double hi = static_cast(x); // Do a binary search to find the closest value such that `checked_int_pow` recovers the input. //