aboutsummaryrefslogtreecommitdiffstats
path: root/math
diff options
context:
space:
mode:
Diffstat (limited to 'math')
-rw-r--r--math/octave-forge-interval/files/patch-mpfr__to__string__d.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/math/octave-forge-interval/files/patch-mpfr__to__string__d.cc b/math/octave-forge-interval/files/patch-mpfr__to__string__d.cc
index 110ec181d5f..acc19a5addc 100644
--- a/math/octave-forge-interval/files/patch-mpfr__to__string__d.cc
+++ b/math/octave-forge-interval/files/patch-mpfr__to__string__d.cc
@@ -9,3 +9,21 @@
std::numeric_limits
<double>::min_exponent - 1
- exponent);
+@@ -219,7 +219,7 @@ DEFUN_DLD (mpfr_to_string_d, args, nargo
+
+ // shift mantissa by 32 bits to format the first part
+ // sprintf (... "%x" ...) requires an unsigned 4-byte int
+- mantissa *= std::pow (2.0, sizeof (uint32_t) * 8);
++ mantissa *= uint64_t (1) << (sizeof (uint32_t) * 8);
+ uint32_t first_part = static_cast <uint32_t> (mantissa);
+
+ // remove first mantissa part
+@@ -227,7 +227,7 @@ DEFUN_DLD (mpfr_to_string_d, args, nargo
+
+ // shift mantissa by remaining 20 bits such that
+ // it is an integer
+- mantissa *= std::pow (2.0,
++ mantissa *= uint64_t (1) << (
+ std::numeric_limits
+ <double>::digits - 1 - 32);
+ uint32_t second_part = static_cast <uint32_t> (mantissa);