Changeset d80dec in git for libpolys/coeffs/shortfl.cc


Ignore:
Timestamp:
Aug 23, 2013, 1:36:09 PM (11 years ago)
Author:
Martin Lee <martinlee84@…>
Branches:
(u'spielwiese', 'fe61d9c35bf7c61f2b6cbf1b56e25e2f08d536cc')
Children:
2e416bb313f3d70371bd9a38ab5c86e29244f713
Parents:
737bbc28cadf54fd1dd228d3450a0b5231b137eb
git-author:
Martin Lee <martinlee84@web.de>2013-08-23 13:36:09+02:00
git-committer:
Martin Lee <martinlee84@web.de>2013-08-23 13:39:02+02:00
Message:
fix: nrMapQ (conversion of rationals to short precision floats)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • libpolys/coeffs/shortfl.cc

    r737bbc2 rd80dec  
    441441  mpf_init(e);
    442442  mpf_set_z(e,z);
     443  int sign= mpf_sgn(e);
     444  mpf_abs (e, e);
    443445
    444446  /* if number was an integer, we are done*/
     
    453455    signed long int exp;
    454456    basis = mpf_get_d_2exp(&exp, e);
    455     float f= mpf_sgn(e)*ldexp(basis,exp);
     457    float f= sign*ldexp(basis,exp);
    456458    mpf_clear(e);
    457459    return nf(f).N();
     
    479481  signed long int exp;
    480482  basis = mpf_get_d_2exp(&exp, q);
    481   float f = mpf_sgn(e)*ldexp(basis,exp);
     483  float f = sign*ldexp(basis,exp);
    482484  mpf_clear(e);
    483485  mpf_clear(d);
Note: See TracChangeset for help on using the changeset viewer.