#19280: MPIR gives incorrect result on 32-bit machines
-------------------------------------+-------------------------------------
       Reporter:  cheuberg           |        Owner:
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.9
      Component:  packages:          |   Resolution:
  standard                           |    Merged in:
       Keywords:  mpir               |    Reviewers:
        Authors:  Clemens Heuberger  |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:  u/cheuberg/mpir-   |  f780291ccb0363c69411dfe723de795f2c75093b
  bug                                |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------
Description changed by cheuberg:

Old description:

> In [http://trac.sagemath.org/ticket/18546#comment:21 #18546], a bug in
> mpir only affecting 32 bit machines was described.
>
> {{{
>  #include "mpir.h"
>
> int main()
> {
>
>     mpz_t one, x, w;
>     mpz_init(one);
>     mpz_init(x);
>     mpz_init(w);
>     mpz_set_str(one,
> "62165404551223330269422781018352605012557018849668464680057997111644937126566671941632",
> 10);
>     mpz_set_str(x, "39623752663112484341451587580", 10);
>
>     mpz_tdiv_q(w, one, x);
>     gmp_printf("%Zd\n", one, x, w);
>
> }
> }}}
> outputs 1568892406419848332919986945754866320479099155002496784035
> instead of the correct
> 1568892403497558507879962225846103176600476845510570267609.

New description:

 In [http://trac.sagemath.org/ticket/18546#comment:21 #18546], a bug in
 mpir only affecting 32 bit machines was described.

 {{{
  #include "mpir.h"

 int main()
 {

     mpz_t one, x, w;
     mpz_init(one);
     mpz_init(x);
     mpz_init(w);
     mpz_set_str(one,
 
"62165404551223330269422781018352605012557018849668464680057997111644937126566671941632",
 10);
     mpz_set_str(x, "39623752663112484341451587580", 10);

     mpz_tdiv_q(w, one, x);
     gmp_printf("%Zd\n", w);

 }
 }}}
 outputs 1568892406419848332919986945754866320479099155002496784035 instead
 of the correct 1568892403497558507879962225846103176600476845510570267609.

--

--
Ticket URL: <http://trac.sagemath.org/ticket/19280#comment:22>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to