source: patches/mpfr-2.4.1-branch_update-2.patch @ ba8fca4

clfs-1.2clfs-2.1clfs-3.0.0-systemdclfs-3.0.0-sysvinitsystemdsysvinit
Last change on this file since ba8fca4 was a5d67dc, checked in by Jim Gifford <clfs@…>, 15 years ago

Update MPFR Branch Update Patch

  • Property mode set to 100644
File size: 6.6 KB
  • mpfr-gmp.c

    Submitted By: Jim Gifford (jim at cross-lfs dot org)
    Date: 2009-04-15
    Initial Package Version: 2.4.1
    Origin: MPFR Website
    Upstream Status: Fixed
    Description: See http://www.mpfr.org Website Under Bugs
    
    diff -Naur mpfr-2.4.1.orig/mpfr-gmp.c mpfr-2.4.1/mpfr-gmp.c
    old new  
    301301      if (linenum != -1)
    302302        fprintf (stderr, "%d: ", linenum);
    303303    }
    304   fprintf (stderr, " assertion failed: %s\n", expr);
     304  fprintf (stderr, "MPFR assertion failed: %s\n", expr);
    305305  abort();
    306306}
    307307
  • mpfr-2.4.1

    diff -Naur mpfr-2.4.1.orig/mpfr.h mpfr-2.4.1/mpfr.h
    old new  
    2727#define MPFR_VERSION_MAJOR 2
    2828#define MPFR_VERSION_MINOR 4
    2929#define MPFR_VERSION_PATCHLEVEL 1
    30 #define MPFR_VERSION_STRING "2.4.1"
     30#define MPFR_VERSION_STRING "2.4.1-p5"
    3131
    3232/* Macros dealing with MPFR VERSION */
    3333#define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c))
  • mpfr-2.4.1

    diff -Naur mpfr-2.4.1.orig/PATCHES mpfr-2.4.1/PATCHES
    old new  
     1zeta_ui-shift
     2vasprintf-mp_limb_t
     3assert
     4remainder-neg
  • mpfr-2.4.1

    diff -Naur mpfr-2.4.1.orig/rem1.c mpfr-2.4.1/rem1.c
    old new  
    170170    }
    171171
    172172  if (mpz_cmp_ui (r, 0) == 0)
    173     inex = mpfr_set_ui (rem, 0, GMP_RNDN);
     173    {
     174      inex = mpfr_set_ui (rem, 0, GMP_RNDN);
     175      /* take into account sign of x */
     176      if (signx < 0)
     177        mpfr_neg (rem, rem, GMP_RNDN);
     178    }
    174179  else
    175180    {
    176181      if (rnd_q == GMP_RNDN)
     
    190195                *quo += 1;
    191196            }
    192197        }
     198      /* take into account sign of x */
     199      if (signx < 0)
     200        mpz_neg (r, r);
    193201      inex = mpfr_set_z (rem, r, rnd);
    194202      /* if ex > ey, rem should be multiplied by 2^ey, else by 2^ex */
    195203      MPFR_EXP (rem) += (ex > ey) ? ey : ex;
     
    198206  if (quo)
    199207    *quo *= sign;
    200208
    201   /* take into account sign of x */
    202   if (signx < 0)
    203     {
    204       mpfr_neg (rem, rem, GMP_RNDN);
    205       inex = -inex;
    206     }
    207 
    208209  mpz_clear (mx);
    209210  mpz_clear (my);
    210211  mpz_clear (r);
  • tests/tfprintf.c

    diff -Naur mpfr-2.4.1.orig/tests/tfprintf.c mpfr-2.4.1/tests/tfprintf.c
    old new  
    195195  check_vfprintf (fout, "a. %Pu, b. %c, c. %Zi%Zn", prec, ch, mpz, &mpz);
    196196  check_length_with_cmp (6, mpz, 17, mpz_cmp_ui (mpz, 17), Zi);
    197197  check_vfprintf (fout, "%% a. %#.0RNg, b. %Qx%Rn, c. %p", mpfr, mpq, &mpfr,
    198                   &i);
     198                  (void *) &i);
    199199  check_length_with_cmp (7, mpfr, 16, mpfr_cmp_ui (mpfr, 16), Rg);
    200200
    201201#ifndef NPRINTF_T
  • tests/tprintf.c

    diff -Naur mpfr-2.4.1.orig/tests/tprintf.c mpfr-2.4.1/tests/tprintf.c
    old new  
    191191  check_length (5, sz, 34, zu);
    192192  check_vprintf ("a. %Pu, b. %c, c. %RUG, d. %Zi%Zn", prec, ch, mpfr, mpz, &mpz);
    193193  check_length_with_cmp (6, mpz, 24, mpz_cmp_ui (mpz, 24), Zi);
    194   check_vprintf ("%% a. %#.0RNg, b. %Qx%Rn c. %p", mpfr, mpq, &mpfr, &i);
     194  check_vprintf ("%% a. %#.0RNg, b. %Qx%Rn c. %p",
     195                 mpfr, mpq, &mpfr, (void *) &i);
    195196  check_length_with_cmp (7, mpfr, 16, mpfr_cmp_ui (mpfr, 16), Rg);
    196197
    197198#ifndef NPRINTF_T
  • tests/tremquo.c

    diff -Naur mpfr-2.4.1.orig/tests/tremquo.c mpfr-2.4.1/tests/tremquo.c
    old new  
    2525
    2626#include "mpfr-test.h"
    2727
     28static void
     29bug20090227 (void)
     30{
     31  mpfr_t x, y, r1, r2;
     32  int inex1, inex2;
     33
     34  mpfr_init2 (x, 118);
     35  mpfr_init2 (y, 181);
     36  mpfr_init2 (r1, 140);
     37  mpfr_init2 (r2, 140);
     38  mpfr_set_si (x, -1, GMP_RNDN);
     39  mpfr_set_str_binary (y, "1.100100100001111110110101010001000100001011010001100001000110100110001001100011001100010100010111000000011011100000111001101000100101001000000100100111000001000100010100110011111010");
     40  inex1 = mpfr_remainder (r1, x, y, GMP_RNDU);
     41  /* since the quotient is -1, r1 is the rounding of x+y */
     42  inex2 = mpfr_add (r2, x, y, GMP_RNDU);
     43  if (mpfr_cmp (r1, r2))
     44    {
     45      printf ("Error in mpfr_remainder (bug20090227)\n");
     46      printf ("Expected ");
     47      mpfr_dump (r2);
     48      printf ("Got      ");
     49      mpfr_dump (r1);
     50      exit (1);
     51    }
     52  mpfr_clear (x);
     53  mpfr_clear (y);
     54  mpfr_clear (r1);
     55  mpfr_clear (r2);
     56}
     57
    2858int
    2959main (int argc, char *argv[])
    3060{
     
    5080
    5181  tests_start_mpfr ();
    5282
     83  bug20090227 ();
     84
    5385  mpfr_init (x);
    5486  mpfr_init (y);
    5587  mpfr_init (r);
  • vasprintf.c

    diff -Naur mpfr-2.4.1.orig/vasprintf.c mpfr-2.4.1/vasprintf.c
    old new  
    398398        (void) va_arg ((ap), mpq_srcptr);       \
    399399        break;                                  \
    400400      case MP_LIMB_ARG:                         \
    401         (void) va_arg ((ap), mp_ptr);           \
     401        (void) va_arg ((ap), mp_limb_t);        \
    402402        break;                                  \
    403403      case MP_LIMB_ARRAY_ARG:                   \
    404404        (void) va_arg ((ap), mp_ptr);           \
  • mpfr-2.4.1

    diff -Naur mpfr-2.4.1.orig/VERSION mpfr-2.4.1/VERSION
    old new  
    1 2.4.1
     12.4.1-p5
  • version.c

    diff -Naur mpfr-2.4.1.orig/version.c mpfr-2.4.1/version.c
    old new  
    2525const char *
    2626mpfr_get_version (void)
    2727{
    28   return "2.4.1";
     28  return "2.4.1-p5";
    2929}
  • zeta_ui.c

    diff -Naur mpfr-2.4.1.orig/zeta_ui.c mpfr-2.4.1/zeta_ui.c
    old new  
    177177                  mpz_mul_ui (t, t, 2 * k - 1);
    178178                }
    179179              mpz_div_2exp (t, t, 1);
    180               if (n < 1UL << (BITS_PER_MP_LIMB / 2))
     180              /* Warning: the test below assumes that an unsigned long
     181                 has no padding bits. */
     182              if (n < 1UL << ((sizeof(unsigned long) * CHAR_BIT) / 2))
    181183                /* (n - k + 1) * (n + k - 1) < n^2 */
    182184                mpz_divexact_ui (t, t, (n - k + 1) * (n + k - 1));
    183185              else
Note: See TracBrowser for help on using the repository browser.