summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Updated version to 3.1.6-rc1 and updated libmpfr_la_LDFLAGS invlefevre2017-08-283-3/+3
| | | | | | src/Makefile.am for the next release. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@11681 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-gmp.h,tests/tests.c] Got rid of __gmp_randstate_struct, whichvlefevre2017-08-271-2/+0
| | | | | | | | is internal to GMP: its use came from very old code (r2330 in 2003-06) and it is no longer needed. (marked changeset r11652 as merged from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@11666 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/urandom.c] Generate the exception flags for mpfr_urandom almost asvlefevre2017-08-221-26/+51
| | | | | | | | | | | | | | | | | | | | expected: * Set the underflow flag if the drawn exponent is less than emin. This corresponds to "underflow before rounding" while the normal rule in MPFR is "underflow after rounding". This is not fixable in the 3.1 branch since the significand is not drawn in this case, and drawing the significand to determine whether there is an underflow would change the state of the PRNG at the end of the function, breaking the ABI and the users' expectations. * Set the inexact flag on underflow (this was not done before). [tests/turandom.c] Added underflow and overflow tests. [doc/mpfr.texi] Documented the above issue with the underflow flag for mpfr_urandom. (merged changesets r11220,11635,11637-11641,11643-11647 from the trunk; instead of merging the conflicting r11636, did all the changes manually; replaced mpfr_flags_t by unsigned int) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@11649 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/urandom.c] Fixed bug reported by Trevor Spiteri:vlefevre2017-08-221-4/+4
| | | | | | | | <https://sympa.inria.fr/sympa/arc/mpfr/2017-01/msg00020.html> [tests/turandom.c] Added non-regression test. (merged changesets r11218-11219,11221 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@11648 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/sin_cos.c] Avoid integer overflows with precision 1100000 andvlefevre2017-07-171-2/+4
| | | | | | | | the 32-bit ABI (32-bit long), fixing bug reported by Simon Byrne: https://sympa.inria.fr/sympa/arc/mpfr/2017-07/msg00002.html (merged changeset r11590 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@11591 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Fixed the mpfr_get_default_rounding_mode() macro forvlefevre2017-06-051-5/+9
| | | | | | | | C++ (it didn't have the correct type), and improved the similar ones. (merged changeset r8997 from the trunk; needed by r11579 when using a C++ compiler) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@11580 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpf2mpfr.h] Fixed mpf_fits_s* and mpf_get_si macros.vlefevre2017-06-051-4/+4
| | | | | | | | [tests/mpf_compat.h] Added non-regression tests. (merged changesets r11565,11571 from the trunk, and did some changes in the inclusions of header files due to the use of MPFR_ASSERTN) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@11579 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/vasprintf.c] In a macro definition, changed a parameter tovlefevre2017-05-291-4/+4
| | | | | | | lowercase so that it doesn't look like a constant to mpfrlint. (merged changeset r11521 from the trunk, completing r11538) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@11541 280ebfd0-de03-0410-8827-d642c229c3f4
* [src] Moved "#include <errno.h>" from printf.c to vasprintf.c (thisvlefevre2017-05-282-1/+2
| | | | | | | | | | | should have been done in r5230, where EOVERFLOW was moved). (merged changeset r11532 from the trunk) [tests/tprintf.c] Added errno test for check_long_string(), which is called when MPFR_CHECK_LARGEMEM is defined, to trigger the above bug. A merge from the trunk was not possible due to many changes in the mpfr_*printf code and the tests. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@11539 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/vasprintf.c] Fixed overflow checking in partition_number().vlefevre2017-05-281-24/+24
| | | | | | | | | | | | | | | | | In details: * The computation of the number of characters to be written could be incorrect by 1 when the thousands separator was not empty. However, in the 3.1 branch (without additional patches), this value is currently only used for overflow checking, so that this bug could have only very little effect (contrary to the trunk). * When the int and long types have the same size, the code assumed "wrapping behavior in two's complement". But this is actually undefined behavior in ISO C; in practice, a smart compiler may have ignored "total < 0" tests, because total is computed with sums of non-negative integers. (merged changesets r11513,11515-11516 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@11538 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] In the MPFR_RET macro, avoid the use of an integervlefevre2017-05-281-1/+1
| | | | | | | | | | | | | | in a boolean context (even though that this is not wrong in C). Fix after a bug report from David Binderman. Explanations: https://sympa.inria.fr/sympa/arc/mpfr/2016-09/msg00028.html (merged changeset r10879 from the trunk) NOTE. This change has been merged in the 3.1 branch because it is needed to be able to build MPFR with -Wall -Werror as of GCC 7, due to the new -Wint-in-bool-context option enabled by -Wall: https://gcc.gnu.org/gcc-7/changes.html git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@11536 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/sum.c] Added a note about the "const" position in the prototypes.vlefevre2017-02-211-0/+8
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@11329 280ebfd0-de03-0410-8827-d642c229c3f4
* Copyright notice update: added 2017 withvlefevre2017-01-01248-248/+248
| | | | | | | | | perl -pi -e 's/ (\d{4}-)?(2016)(?= Free Software)/ " ".($1||"$2-").($2+1)/e' **/*(^/) under zsh (the m4 and tools/mbench directories were not modified). Removed 2016 from the example in the doc/README.dev file. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@11119 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/strtofr.c] Fixed bug in mpfr_strtofr(): in round-to-nearest,vlefevre2016-12-191-5/+8
| | | | | | | | | the ternary value could be incorrect. [tests/tstrtofr.c] Added test case. (merged changesets from the trunk: r11055, a part of r11056, and r11059,11066-11068) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@11069 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/vasprintf.c] Fixed a bug: spec.prec can be a negative number othervlefevre2016-12-151-1/+1
| | | | | | | | than -1 (when such a value is given as an argument with ".*"). [tests/tsprintf.c] Added non-regression test. (merged changesets r11037-11038 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@11043 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Fixed r10917 (thanks to Eli Zaretskii for the report).vlefevre2016-10-251-1/+2
| | | | | | (merged changeset r10920 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10921 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Improved a macro from r10917 (just in case...).vlefevre2016-10-241-1/+1
| | | | | | (merged changeset r10918 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10919 280ebfd0-de03-0410-8827-d642c229c3f4
* [src] Support build as thread-safe DLL on Windows: clean-up.vlefevre2016-10-248-90/+39
| | | | | | | | | | | | | * Increased the use of macros to avoid some code duplication (with risks of typos) and to prevent the problems related to thread-safe DLL from appearing in the .c files. * The prototypes of the functions to access the address of a TLS variable are now defined. Otherwise one gets warnings: https://sympa.inria.fr/sympa/arc/mpfr/2016-10/msg00004.html (merged changeset r10916 from the trunk, with conflict resolved by replacing mpfr_flags_t with unsigned int) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10917 280ebfd0-de03-0410-8827-d642c229c3f4
* Updated version to 3.1.6-dev.vlefevre2016-09-272-3/+3
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10896 280ebfd0-de03-0410-8827-d642c229c3f4
* Updated version to 3.1.5.vlefevre2016-09-272-2/+2
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10891 280ebfd0-de03-0410-8827-d642c229c3f4
* Updated version to 3.1.5-rc1 and updated libmpfr_la_LDFLAGS invlefevre2016-09-133-3/+3
| | | | | | src/Makefile.am for the next release. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10866 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/get_ld.c] Re-added a blank line that disappeared in a merge.vlefevre2016-09-121-0/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10857 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/get_ld.c] Removed a "see below", which refers to a comment thatvlefevre2016-09-121-1/+1
| | | | | | is in the trunk but not in this branch. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10856 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/get_ld.c] Fixed bug for little-endian x86 extended precision.vlefevre2016-09-081-2/+1
| | | | | | | [tests/tset_ld.c] Added test case. (merged changesets r10807-10809,10811-10812 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10815 280ebfd0-de03-0410-8827-d642c229c3f4
* Fixed various bugs in mpfr_can_round_raw, which affected mpfr_can_round:vlefevre2016-09-054-56/+276
| | | | | | | | | | | | | | there could still be false positives (i.e. mpfr_can_round could say that rounding was possible while correct rounding was not guaranteed), and also false negatives, some of which could yield infinite Ziv loops in user code in practice. Added tests triggering these bugs, in particular a comprehensive test against a naive implementation. (merged changesets r10679-10686,10717-10718,10743,10746-10748,10752,10754,10756 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10792 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/sub1.c] Fixed bug in mpfr_sub1 (real subtraction b - c, |b| > |c|):vlefevre2016-05-291-5/+9
| | | | | | | | | | | | | In MPFR_RNDN (rounding to nearest), when |b| is the midpoint between the maximum number and 2^emax (the maximum number + 1 ulp) and c is small, the obtained result is an infinity (with overflow) instead of ± the maximum number (no overflow). The cause is that an overflow is generated too early (in the rounding code). [tests/tsub.c] Added test cases. (merged changeset r10383 from the trunk, with conflict resolved in src/sub1.c and mpfr_flags_t replaced by unsigned int) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10384 280ebfd0-de03-0410-8827-d642c229c3f4
* For mpfr_add_ui and mpfr_sub_ui, make sure that all the expected flagsvlefevre2016-05-222-0/+2
| | | | | | | | | are set (in practice, only NaN was affected). Added testcases from the trunk (merged r10298 and r10303). Note: the trunk was fixed with a partial rewrite for some optimization and to improve consistency, but here, the changes are kept minimal. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10304 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Removed the detection of possible inconsistenciesvlefevre2016-04-131-13/+0
| | | | | | | | | | | | | under Unix because the tests could yield spurious errors with Cygwin32 or other similar implementations. Moreover, such tests were used for debugging purpose or to detect potential problems in the environment, thus were not really useful for the end user. They were initially added in the win-thread-safe-dll branch (r9682, following a problem found in r9680). One alternative for checking by the MPFR developers would be to output the status of some internal macros in tversion. (merged changeset r10260 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10264 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Fixed and improved some sign-related macrosvlefevre2016-03-151-18/+22
| | | | | | | | | (some parentheses were missing). Note: the code in the 3.1 branch was not affected by these missing parentheses; however this could break later patches or ports of new functions using MPFR internals. (merged changeset r9295 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10234 280ebfd0-de03-0410-8827-d642c229c3f4
* Updated version to 3.1.5-dev.vlefevre2016-03-062-3/+3
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10204 280ebfd0-de03-0410-8827-d642c229c3f4
* Updated version to 3.1.4.vlefevre2016-03-062-2/+2
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10199 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/get_flt.c] FIXME: The code assumes the IEEE-754 binary32 formatvlefevre2016-03-021-0/+3
| | | | | | | with subnormal support. (merged changeset r10175 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10176 280ebfd0-de03-0410-8827-d642c229c3f4
* reverted commit 10144 (wrongly applied to branch 3.1 instead of trunk)zimmerma2016-02-291-63/+0
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10149 280ebfd0-de03-0410-8827-d642c229c3f4
* native detection of ieee_double_extract (work in progress),zimmerma2016-02-291-0/+63
| | | | | | | | this will allow to have decimal-float support without gmp-build (and also faster set_d/get_d) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10144 280ebfd0-de03-0410-8827-d642c229c3f4
* fixed typozimmerma2016-02-291-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10142 280ebfd0-de03-0410-8827-d642c229c3f4
* Better threading support:vlefevre2016-02-269-25/+137
| | | | | | | | | | * Support for _Thread_local (C11). * Support build as thread-safe DLL on Windows (mainly changes from Stephan Tolksdorf). (merged changesets r7954,8245,9684,9778 from the trunk, with mpfr_flags_t replaced by unsigned int) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10130 280ebfd0-de03-0410-8827-d642c229c3f4
* Updated version to 3.1.4-rc2.vlefevre2016-02-242-2/+2
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10117 280ebfd0-de03-0410-8827-d642c229c3f4
* Updated version to 3.1.4-rc1 and updated libmpfr_la_LDFLAGS invlefevre2016-02-233-3/+3
| | | | | | src/Makefile.am for the next release. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10095 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/{cmp_d.c,cmp_ld.c}] Bug fixes: mpfr_cmp_d (resp. mpfr_cmp_ld) wasvlefevre2016-02-232-2/+16
| | | | | | | | | | | | setting the NaN flag when the double (resp. long double) was a NaN and could return an incorrect result (assertion failure in debug mode) in reduced exponent range. [tests/{tcmp_d.c,tcmp_ld.c}] Added a test in reduced exponent range. Full test of the flags for NaN. (merged changesets r10087-10089 from the trunk, with replacement of new features of the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10090 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/sum.c] Fixed bugs in mpfr_sum, which could return wrong resultsvlefevre2016-02-222-14/+26
| | | | | | | | | | | | | | | | | | when not all the numbers have the same precision. A side effect is that this can make mpfr_sum much slower and/or take much more memory in some of such cases with the same program; this is normal and cannot easily be avoided with the current algorithm. Note: The full rewrite currently in the trunk has not been merged because this would not be a simple patch (and it is still incomplete when a number is reused as the output). [src/mpfr-impl.h] Updated the prototype of mpfr_sum_sort. Note: Since this function is used only internally and by the tests, this does not break the ABI. However the old and new tsum tests are source & binary incompatible. [tests/tsum.c] Updated the use of mpfr_sum_sort. Added a testcase. (merged changesets r8697,8699,8701,8851 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10083 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/agm.c] Fixed bug in mpfr_agm in case the two FP inputs havevlefevre2016-02-221-4/+1
| | | | | | | | | the same value but the result cannot be exactly represented in the target precision: the ternary value was wrongly set to 0. [tests/tagm.c] Added testcase. (merged changesets r10060,10077 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10078 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/rem1.c] Fixed bug in the mpfr_rem1 internal function (used byvlefevre2016-02-191-7/+35
| | | | | | | | mpfr_remainder, mpfr_remquo and mpfr_fmod): MPFR can take much memory or crash when using inputs with a huge difference in magnitude. [tests/{tfmod.c,tremquo.c}] Testcases. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10075 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/gamma.c] Bug fix in case the argument is an integer fitting in anvlefevre2016-02-191-0/+5
| | | | | | | | unsigned long: flags may be set while they shouldn't, and the result may be incorrect in a very reduced exponent range. (merged changesets r10043-10045 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10071 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/root.c] Fixed root(x,k) for large very values of k: MPFR couldvlefevre2016-02-151-58/+132
| | | | | | | | | | | | | | crash or take much memory, and the function could return incorrect values. This is done by changing the algorithm for k > 100. This patch is rather safe as applications that only use small values of k (≤ 100) won't see any change, and for applications that may use large values of k, this change may be needed. [tests/troot.c] Added tests. (merged changesets r9921-9928,9930-9931,9965-9970,9973-9974,10036,10038 from the trunk, with mpfr_flags_t replaced by unsigned int; for r9965, the merged was done only on the src directory) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10040 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Merged r9970 to simplify a future patch generation.vlefevre2016-02-151-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10039 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/{fits_intmax.c,fits_s.h,fits_u.h}] Fixed mpfr_fits_* functions: thevlefevre2016-02-153-3/+27
| | | | | | | | | | | flags could be modified, and an assertion failure could be triggered in debug mode (additional assertion checking) for non-integer numbers just above the positive limit. [tests/tfits.c] Many new tests. (merged changesets r9650,9653-9655,10030-10034 from the trunk, with mpfr_flags_t replaced by unsigned int) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10035 280ebfd0-de03-0410-8827-d642c229c3f4
* Fixed bug in mpfr_can_round_raw, which affected mpfr_can_round: thevlefevre2016-02-123-49/+88
| | | | | | | | | | | result could be true instead of false in case of a change of binade (exponent decrease) on the approximation interval. At the same time, make sure that the number is normalized, and ditto for mpfr_round_p; otherwise the semantic is not clear. Thus mpfr_div, which could call mpfr_round_p with an unnormalized number, had to be fixed. (merged changesets r9881,9883-9890,9896-9904,9932,10027 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10029 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/exp3.c] Merged r9883 to simplify a future patch generationvlefevre2016-02-121-1/+1
| | | | | | | (fix of comment formatting, which shouldn't have been with the other r9883 changes). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10026 280ebfd0-de03-0410-8827-d642c229c3f4
* Fixed bug in si operations (mpfr_add_si, mpfr_sub_si, mpfr_si_sub,vlefevre2016-02-124-9/+12
| | | | | | | | mpfr_mul_si, mpfr_div_si, mpfr_si_div) when the integer is LONG_MIN, visible when using an UB sanitizer. (merged changesets r9998-9999,10003,10005 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10023 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/eint.c] Typo in a comment.vlefevre2016-02-091-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@10009 280ebfd0-de03-0410-8827-d642c229c3f4