summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* [src/get_str.c] Added some logging (MPFR_LOG_*), which triggers a crashvlefevre2014-10-301-0/+14
| | | | | | | | | | in tget_str with MPFR_LOG_ALL=1. An analysis with gdb shows that this is due to an invalid MPFR number in mpfr_ceil_mul(). Added a MPFR_ASSERTD (mpfr_check (p)); there, which fails in tget_str (this was the cause of the crash), even without logging. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9222 280ebfd0-de03-0410-8827-d642c229c3f4
* mpfr_get_str now sets the NaN flag on NaN input. See:vlefevre2014-10-291-0/+1
| | | | | | | | | https://sympa.inria.fr/sympa/arc/mpfr/2014-10/msg00013.html and https://gforge.inria.fr/tracker/index.php?func=detail&aid=18228&group_id=136&atid=619 Also completed the mpfr_get_str description in mpfr.texi concerning the special numbers and the exception flags. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9221 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/get_str.c] Improved style consistency.vlefevre2014-10-281-18/+19
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9218 280ebfd0-de03-0410-8827-d642c229c3f4
* [src] Cleaner use of MPFR_SET_SIGN.vlefevre2014-08-215-10/+12
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9187 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr.h] Fixed the mpfr_signbit() macro, which depended onvlefevre2014-08-171-1/+1
| | | | | | | mpfr-impl.h (the problem wasn't detected in the tests since mpfr-impl.h is included in them). Thanks to Rob for the bug report. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9177 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/ai.c] Corrected log messages.vlefevre2014-08-051-4/+6
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9162 280ebfd0-de03-0410-8827-d642c229c3f4
* Update concerning the P type specifier for formatted output, sincevlefevre2014-08-051-1/+1
| | | | | | | | | | mpfr_prec_t was changed to a signed type in MPFR 3.0.0. * doc/mpfr.texi: d and i can be used (o, u, x, and X are still OK in practice since a mpfr_prec_t value is usually nonnegative); changed a "unsigned int" to "int". * src/vasprintf.c: updated a comment. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9160 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/get_str.c] Coding style: better code for a boolean.vlefevre2014-07-201-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9156 280ebfd0-de03-0410-8827-d642c229c3f4
* Do not test include guards before a #include: the test must be done onlyvlefevre2014-07-102-19/+6
| | | | | | | | in the included file itself. Note that some files such as mpfr.h may have multiple parts that could be enabled depending on the context, so that testing a guard before a #include may yield incorrect behavior. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9150 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mul.c] Fixed a test when MPFR_WANT_ASSERT >= 2 (NaN with non-NaNvlefevre2014-07-071-2/+2
| | | | | | was not detected as an error). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9143 280ebfd0-de03-0410-8827-d642c229c3f4
* [src] MPFR_WANT_ASSERT clean-up.vlefevre2014-07-075-41/+44
| | | | | | | | Note: the mul.c test for MPFR_WANT_ASSERT >= 3 is now enabled for MPFR_WANT_ASSERT = 2 (since setting MPFR_WANT_ASSERT to 3 was not possible with configure options), and fixed. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9142 280ebfd0-de03-0410-8827-d642c229c3f4
* Added debug of branch prediction / --enable-debug-prediction configurevlefevre2014-07-072-4/+89
| | | | | | option (patch from Patrick Pélissier, with some changes). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9141 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/round_raw_generic.c] Updated comment about MPFR_RNDNA.vlefevre2014-07-021-1/+4
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9139 280ebfd0-de03-0410-8827-d642c229c3f4
* Removed the need of MPFR_USE_MINI_GMP tests for mpfr_[ne]randomvlefevre2014-07-024-31/+0
| | | | | | | | | functions (source and tests) as mpfr_random_deviate_value no longer needs mpq_t (since r9066). Also removed a static assertion in src/random_deviate.c for the same reason. Note: the change done in r9133 is now really useful! git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9135 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr.h] Added other missing "#ifndef MPFR_USE_MINI_GMP".vlefevre2014-07-021-2/+8
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9134 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr.h] Added a missing "#ifndef MPFR_USE_MINI_GMP"vlefevre2014-07-021-0/+2
| | | | | | (not really useful, but cleaner). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9131 280ebfd0-de03-0410-8827-d642c229c3f4
* Renamed WANT_MINI_GMP to MPFR_USE_MINI_GMP as it is used in mpfr.hvlefevre2014-07-0212-16/+16
| | | | | | | (all MPFR macros that appear there should start with MPFR_ to avoid conflicts with other software). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9129 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mul.c] Minor correction of a comment.vlefevre2014-07-021-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9124 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr.h] For the mpfr_{mul,div}_si macros: s/positive/non-negative/vlefevre2014-06-301-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9114 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr.h] Coding style.vlefevre2014-06-301-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9112 280ebfd0-de03-0410-8827-d642c229c3f4
* New macros for mpfr_{mul,div}_ui to optimize the call when the integervlefevre2014-06-303-0/+39
| | | | | | | | | is a constant number that is a power of 2. New macros for mpfr_{mul,div}_si to optimize the call when the integer is a constant number that is positive. (Modified patch from Patrick Pélissier) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9111 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/vasprintf.c] Improved comments.vlefevre2014-06-261-2/+2
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9109 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/vasprintf.c] Fixed assertion failures for tiny numbers (the codevlefevre2014-06-261-2/+6
| | | | | | was correct, but the assertions didn't check against the right bound). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9108 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/div.c] Bug fix: avoid integer overflow in the code added in r9086vlefevre2014-06-261-1/+7
| | | | | | (now tdiv no longer fails). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9107 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/div.c] Bug fix: avoid an integer overflow when dividing thevlefevre2014-06-261-2/+6
| | | | | | | largest finite MPFR number by the smallest positive one. (merged changeset r9105 from the 3.1 branch) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9106 280ebfd0-de03-0410-8827-d642c229c3f4
* speedup in mpfr_div for n/n division, using mpz_tdiv_qzimmerma2014-06-251-0/+111
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9095 280ebfd0-de03-0410-8827-d642c229c3f4
* Use MPFR_IS_NEG and MPFR_IS_POS instead of comparing the sign with 0.vlefevre2014-06-2518-27/+27
| | | | | | | | | | | Done with perl -pi -e ' s/MPFR_SIGN *\(([^)]+)\) *<=? *0/MPFR_IS_NEG ($1)/g; s/MPFR_SIGN *\(([^)]+)\) *>=? *0/MPFR_IS_POS ($1)/g; ' {src,tests}/*.{c,h} and some manual changes. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9092 280ebfd0-de03-0410-8827-d642c229c3f4
* More code clean-up (for both consistency and readability):vlefevre2014-06-2513-24/+27
| | | | | | | | | | | | | | | * Use the simple mp_limb_t constants when possible. * New internal macro MPFR_IS_NORMALIZED. Note: this was done with perl -pi -e ' s/~ *\(mp_limb_t\) *0/MPFR_LIMB_MAX/g; s/\(mp_limb_t\) *-1/MPFR_LIMB_MAX/g; s/\(mp_limb_t\) *0/MPFR_LIMB_ZERO/g; s/\(mp_limb_t\) *1L?/MPFR_LIMB_ONE/g' {src,tests}/*.{c,h} svn revert src/mpfr-impl.h and some manual changes. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9091 280ebfd0-de03-0410-8827-d642c229c3f4
* Code clean-up:vlefevre2014-06-258-36/+20
| | | | | | | | | | * Simplified the definition of simple mp_limb_t constants: it is better to avoid GMP internals when there is a standard way. * Replaced the use of MP_LIMB_T_MAX by the new macro MPFR_LIMB_MAX. * So, removed the now useless MP_LIMB_T_MAX and GMP_LIMB_HIGHBIT definitions from "mpfr-gmp.h". git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9090 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-mini-gmp.h] GMP_NUMB_MASK is no longer needed.vlefevre2014-06-251-4/+0
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9089 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/div.c] In the case where the divisor has one limb (latest commit),vlefevre2014-06-251-1/+2
| | | | | | | | | | | | check that the value of this limb fits in an unsigned long, otherwise mpfr_div_ui cannot be used. Indeed, according to the GMP manual §2.2, a limb may be a long long (actually unsigned): For example in some 32-bit ABIs, GMP may support a limb as either a 32-bit `long' or a 64-bit `long long'. Note: if a limb is an unsigned long, this new test will be no-op, since always true. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9087 280ebfd0-de03-0410-8827-d642c229c3f4
* speedup of mpfr_div when divisor has one limbzimmerma2014-06-251-0/+22
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9086 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/random_deviate.h] Fixed prototypes:vlefevre2014-06-251-27/+34
| | | | | | | | | | * Added __MPFR_DECLSPEC to avoid failure with Windows DLL; see https://sympa.inria.fr/sympa/arc/mpfr/2014-06/msg00003.html * Added _MPFR_PROTO for consistency (though it will probably be removed in the near future). * Removed variable names (coding style). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9085 280ebfd0-de03-0410-8827-d642c229c3f4
* Updated URL's.vlefevre2014-06-225-11/+11
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9081 280ebfd0-de03-0410-8827-d642c229c3f4
* patches from Charles Karneyzimmerma2014-06-171-32/+8
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9066 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mul.c] English usage in a comment.vlefevre2014-06-051-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9059 280ebfd0-de03-0410-8827-d642c229c3f4
* [free_cache.c] Avoid mixed declarations and code for ISO C90 support.vlefevre2014-04-151-5/+7
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9031 280ebfd0-de03-0410-8827-d642c229c3f4
* BYTES_PER_MP_LIMB -> MPFR_BYTES_PER_MP_LIMB for GMP 6 compatibilityzimmerma2014-04-157-20/+19
| | | | | | | when --with-gmp-build is used. See mailing-list discussion: https://sympa.inria.fr/sympa/arc/mpfr/2014-04/msg00000.html git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9029 280ebfd0-de03-0410-8827-d642c229c3f4
* mpn_sqrtrem (rp, sp, sp, rrsize) is faster thanzimmerma2014-03-251-1/+1
| | | | | | | mpn_sqrtrem (rp, NULL, sp, rrsize): avoids one allocation and one copy git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9019 280ebfd0-de03-0410-8827-d642c229c3f4
* Added MPFR_PREC_COND, MPFR_PREC_IN_RANGE and MPFR_GET_PREC internalvlefevre2014-03-2514-22/+37
| | | | | | | | macros (to mpfr-impl.h). Use these macros at some places in the code (replacing some MPFR_PREC instances, as suggested by a patch from Patrick Pélissier). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9016 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Added an MPFR_ASSERTD in MPFR_MPZ_SIZEINBASE2vlefevre2014-03-251-1/+2
| | | | | | (from a patch by Patrick Pélissier). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9015 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/sqrt.c] Replaced a MPFR_EXP by MPFR_SET_EXP (from a patch byvlefevre2014-03-251-2/+1
| | | | | | Patrick Pélissier). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9014 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/div.c] Added MPFR_ASSERTD assertions and improved a testvlefevre2014-03-251-4/+9
| | | | | | (patch from Patrick Pélissier). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@9013 280ebfd0-de03-0410-8827-d642c229c3f4
* Added a TODO item concerning gmp_op.c functions with mpz_srcptr andvlefevre2014-03-101-0/+5
| | | | | | the use of mpz_fits_slong_p and a mpfr_*_si function (see r8992). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8998 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Fixed the mpfr_get_default_rounding_mode() macro forvlefevre2014-03-021-5/+9
| | | | | | C++ (it didn't have the correct type), and improved the similar ones. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8997 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/lngamma.c] Fixed allocation.vlefevre2014-03-021-6/+5
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8996 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/lngamma.c] Temporarily disabled fast argument reconstructionvlefevre2014-03-021-1/+2
| | | | | | because it doesn't compile with g++. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8995 280ebfd0-de03-0410-8827-d642c229c3f4
* Removed trailing spaces.vlefevre2014-03-011-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8994 280ebfd0-de03-0410-8827-d642c229c3f4
* [lngamma.c] implemented fast way of computing x*(x+1)*...*(x+k-1)zimmerma2014-02-281-17/+89
| | | | | | | (it remains to speed up the computation of the Bernoulli numbers) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8993 280ebfd0-de03-0410-8827-d642c229c3f4
* speedup of the mpfr_xxx_z functions when z fits in a longzimmerma2014-02-281-11/+17
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@8992 280ebfd0-de03-0410-8827-d642c229c3f4