source: patches/mpfr-2.4.1-branch_update-1.patch@ 4a3510d

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 4a3510d was 62069df, checked in by Jim Gifford <clfs@…>, 16 years ago

Updated MPFR to 2.4.1

  • Property mode set to 100644
File size: 3.6 KB
  • mpfr-2.4.1

    Submitted By: Jim Gifford (jim at cross-lfs dot org)
    Date: 2009-02-28
    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.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-p1"
    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  
     1remainder-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/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);
  • 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-p1
  • 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-p1";
    2929}
Note: See TracBrowser for help on using the repository browser.