Skip to content

Instantly share code, notes, and snippets.

@fxcoudert
Created December 14, 2017 12:45
Show Gist options
  • Save fxcoudert/29dd57bceccad91f9d9284ca8331bbde to your computer and use it in GitHub Desktop.
Save fxcoudert/29dd57bceccad91f9d9284ca8331bbde to your computer and use it in GitHub Desktop.
--- src/mpfi.h.old 2017-12-14 13:17:36.000000000 +0100
+++ src/mpfi.h 2017-12-14 13:17:42.000000000 +0100
@@ -46,7 +46,7 @@ typedef struct {
typedef __mpfi_struct mpfi_t[1];
typedef __mpfi_struct *mpfi_ptr;
-typedef __gmp_const __mpfi_struct *mpfi_srcptr;
+typedef const __mpfi_struct *mpfi_srcptr;
#ifdef __cplusplus
extern "C" {
diff -pur mpfi-1.5.1-old/src/mpfi-impl.h mpfi-1.5.1/src/mpfi-impl.h
--- mpfi-1.5.1-old/src/mpfi-impl.h 2012-01-19 09:48:26.000000000 +0100
+++ mpfi-1.5.1/src/mpfi-impl.h 2017-12-14 13:28:26.000000000 +0100
@@ -69,11 +69,6 @@ MA 02110-1301, USA. */
extern "C" {
#endif
-/* WARNING: this is an MPFR internal function which may be removed in future
- MPFR versions. Should be replaced by mpfr_printf. */
-void mpfr_print_binary _MPFR_PROTO ((mpfr_srcptr));
-
-
mp_prec_t mpfi_quadrant (mpz_ptr, mpfr_srcptr);
int mpfi_cmp_sym_pi (mpz_srcptr, mpfr_srcptr, mpfr_srcptr, mp_prec_t);
diff -pur mpfi-1.5.1-old/src/print_binary.c mpfi-1.5.1/src/print_binary.c
--- mpfi-1.5.1-old/src/print_binary.c 2012-01-19 09:48:26.000000000 +0100
+++ mpfi-1.5.1/src/print_binary.c 2017-12-14 13:34:37.000000000 +0100
@@ -31,8 +31,8 @@ void
mpfi_print_binary (mpfi_srcptr x)
{
printf ("[ ");
- mpfr_print_binary (&(x->left));
+ mpfr_printf ("%Rf", &(x->left));
printf (" , ");
- mpfr_print_binary (&(x->right));
+ mpfr_printf ("%Rf", &(x->right));
printf (" ]");
}
--- mpfi-1.5.1-old/src/diam.c 2012-01-19 09:48:26.000000000 +0100
+++ mpfi-1.5.1/src/diam.c 2017-12-14 13:41:15.000000000 +0100
@@ -57,7 +57,10 @@ mpfi_diam_rel (mpfr_ptr diam, mpfi_srcpt
Note that in case of underflow, mpfr_sgn(center)==0 and the
if-condition fails, preventing the next operation to actually increase
the absolute value of center */
- mpfr_sub_one_ulp (center, MPFI_RNDD);
+ if (mpfr_sgn (center) > 0)
+ mpfr_nextbelow (center);
+ else
+ mpfr_nextabove (center);
}
mpfr_abs (center, center, MPFI_RNDD); /* always exact */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment