From bdb8a9b7a6411ca41aa357ea2da631fdca0713e8 Mon Sep 17 00:00:00 2001 From: Chip Hogg Date: Sat, 20 Jul 2024 10:52:44 -0400 Subject: [PATCH] Explicitly static cast to long double 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/magnitude.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/au/magnitude.hh b/au/magnitude.hh index 1be7957e..f93e3cbd 100644 --- a/au/magnitude.hh +++ b/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. //