summaryrefslogtreecommitdiff
path: root/src/mpfr-impl.h
Commit message (Collapse)AuthorAgeFilesLines
* Fixed various bugs in mpfr_can_round_raw, which affected mpfr_can_round:vlefevre2016-09-051-0/+1
| | | | | | | | | | | | | | 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/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
* Better threading support:vlefevre2016-02-261-19/+77
| | | | | | | | | | * 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
* [src/sum.c] Fixed bugs in mpfr_sum, which could return wrong resultsvlefevre2016-02-221-1/+2
| | | | | | | | | | | | | | | | | | 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/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
* Replacedvlefevre2016-02-041-1/+1
| | | | | | | | Contributed by the AriC and Caramel projects by Contributed by the AriC and Caramba projects git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@9943 280ebfd0-de03-0410-8827-d642c229c3f4
* Copyright notice update: added 2016 withvlefevre2016-01-011-1/+1
| | | | | | | | | perl -pi -e 's/ (\d{4}-)?(2015)(?= Free Software)/ " ".($1||"$2-").($2+1)/e' **/*(^/) under zsh (the m4 and tools/mbench directories were not modified). Removed 2015 from the example in the doc/README.dev file. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@9781 280ebfd0-de03-0410-8827-d642c229c3f4
* Fixed warnings from GCC's -Wold-style-declaration option:vlefevre2015-08-251-1/+1
| | | | | | | MPFR_THREAD_ATTR must be at beginning of declaration. (merged changeset r8725 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@9664 280ebfd0-de03-0410-8827-d642c229c3f4
* [src] Fixed allocation issue for multithreaded applications:vlefevre2015-05-281-8/+6
| | | | | | | | | | | | | https://sympa.inria.fr/sympa/arc/mpfr/2015-05/msg00001.html * mpfr-gmp.{c,h}: made mpfr_allocate_func, mpfr_reallocate_func and mpfr_free_func thread-local; updated MPFR_GET_MEMFUNC to execute mp_get_memory_functions only when these pointers have not been set to the actual function pointers yet. * mpfr-impl.h: #include "mpfr-thread.h" earlier (before mpfr-gmp.h, where MPFR_THREAD_ATTR is now used). (merged changeset r9466 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@9467 280ebfd0-de03-0410-8827-d642c229c3f4
* Renamed WANT_ASSERT to MPFR_WANT_ASSERT in order to avoid a clashvlefevre2015-05-211-4/+4
| | | | | | with GMP when MPFR is configured with --with-gmp-build. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@9431 280ebfd0-de03-0410-8827-d642c229c3f4
* [acinclude.m4] Check struct lconv members (from <locale.h>) to avoid avlefevre2015-05-201-2/+12
| | | | | | | | | | | | | | | build failure under Android, which does not have them; see https://sympa.inria.fr/sympa/arc/mpfr/2012-10/msg00002.html [src/mpfr-impl.h] Decimal point / thousands separator support can now be detected automatically by configure (from the presence of <locale.h> and the above members) or explicitly disabled/enabled by the user by defining the MPFR_LCONV_DPTS macro to 0 or 1 via CFLAGS (a configure switch might be added in the future). [tests/tsprintf.c] Do the locale_da_DK test only if MPFR_LCONV_DPTS is true. (merged changeset r8423 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@9414 280ebfd0-de03-0410-8827-d642c229c3f4
* Copyright notice update: added 2015 withvlefevre2015-05-201-1/+1
| | | | | | | | | perl -pi -e 's/ (\d{4}-)?(2014)(?= Free Software)/ " ".($1||"$2-").($2+1)/e' **/*(^/) under zsh (the m4 and tools/mbench directories were not modified). Removed 2014 from the example in the doc/README.dev file. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@9403 280ebfd0-de03-0410-8827-d642c229c3f4
* BYTES_PER_MP_LIMB -> MPFR_BYTES_PER_MP_LIMB for GMP 6 compatibilityvlefevre2014-04-151-3/+3
| | | | | | | | | | | | | when --with-gmp-build is used. See mailing-list discussion: https://sympa.inria.fr/sympa/arc/mpfr/2014-04/msg00000.html Updated configure test on GMP_NUMB_BITS and sizeof(mp_limb_t): * BYTES_PER_MP_LIMB is no longer tested. * The test is now always run, not just when --with-gmp-build is used. * Results are output in config.log in case of failure. * The error message has been updated. (merged changesets r9029,9030 from the trunk, with conflict resolution) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@9034 280ebfd0-de03-0410-8827-d642c229c3f4
* Copyright notice update: added 2014 withvlefevre2014-01-031-1/+1
| | | | | | | | | | perl -pi -e 's/ (\d{4}-)?(2013)(?= Free Software)/ " ".($1||"$2-").($2+1)/e' **/*(^/) under zsh, reverting the ChangeLog file (the m4 and tools/mbench directories were not modified). Removed 2013 from the example in the doc/README.dev file. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@8724 280ebfd0-de03-0410-8827-d642c229c3f4
* Made changes to avoid test failures with:vlefevre2013-09-271-2/+12
| | | | | | | | | | | | clang -O2 -fsanitize=undefined -fno-sanitize-recover [src/mpfr-impl.h] With clang, disable division by zero using constants due to a bug in its sanitizer and because IEEE 754 division by zero is currently not properly supported. [tests/{tget_flt.c,tset_ld.c}] Avoid divisions by 0 if MPFR_ERRDIVZERO and avoid an overflow on double. (merged changesets r8685-8687,8690 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@8691 280ebfd0-de03-0410-8827-d642c229c3f4
* Use copyright year ranges, followingvlefevre2013-05-301-1/+1
| | | | | | http://www.gnu.org/prep/maintain/maintain.html#Copyright-Notices git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@8541 280ebfd0-de03-0410-8827-d642c229c3f4
* Copyright notice update: added 2013 withvlefevre2013-03-081-1/+1
| | | | | | | | | perl -pi -e 's/2012 Free Software/2012, 2013 Free Software/' **/*(^/) under zsh, reverting the ChangeLog file (the m4 and tools/mbench directories were not modified). Removed 2012 from the example in the doc/README.dev file. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@8465 280ebfd0-de03-0410-8827-d642c229c3f4
* Merged changesets r8172-8173,8175 from the trunk to update URL's ofvlefevre2012-05-031-1/+1
| | | | | | mailing-list archives/messages. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@8176 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Improved macros from the changeset r8080, invlefevre2012-03-091-5/+15
| | | | | | | | particular to avoid an error with the --enable-assert configure option and the -ansi -pedantic-errors gcc compiler flags. (merged changesets r7910,8082,8083 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@8084 280ebfd0-de03-0410-8827-d642c229c3f4
* Avoid potential integer overflows and improve consistency. This shouldvlefevre2012-03-081-9/+14
| | | | | | | | | | | | fix bug #13918 "Segfault with precision = MPFR_PREC_MAX on 32-bit". Note: this problem appeared in MPFR 3.0.0 when the precision type (now mpfr_prec_t) was changed to a signed integer. Added a large precision test in tests/tinits.c (enabled by setting MPFR_CHECK_LARGEMEM=1) to trigger the bug mentioned above on 32-bit machines (or when MPFR is built with -m32). (merged changesets r8025,8026,8029,8031,8077 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@8080 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Use %.*Rg instead of %.*Rf for MPFR_LOG_VAR.vlefevre2012-02-241-1/+1
| | | | | | (merged changeset r8048 from the trunk) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@8049 280ebfd0-de03-0410-8827-d642c229c3f4
* Changed Arenaire to AriC with:vlefevre2012-01-101-1/+1
| | | | | | | perl -pi -e 's/Contributed by the Arenaire/Contributed by the AriC/' **/*(^/) under zsh, reverting the ChangeLog file. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@7995 280ebfd0-de03-0410-8827-d642c229c3f4
* Copyright notice update: added 2012 withvlefevre2012-01-101-1/+1
| | | | | | | | | perl -pi -e 's/2011 Free Software/2011, 2012 Free Software/' **/*(^/) under zsh, reverting the ChangeLog file (the m4 and tools/mbench directories were not modified). Removed 2011 from the example in the doc/README.dev file. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@7987 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Fixed a bug in the MPFR_UNLIKELY macro for GCCvlefevre2011-10-041-2/+3
| | | | | | | (found under Mac OS X / PowerPC with the mode32 GMP ABI, and MPFR built with --enable-assert=full). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/branches/3.1@7908 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Define new macros MPFR_EXT_EMIN and MPFR_EXT_EMAX.vlefevre2011-09-191-2/+6
| | | | | | | [doc/README.dev] Document how to specify the minimum exponent or the maximum exponent. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7863 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Define LONGLONG_STANDALONE before includingvlefevre2011-09-141-0/+1
| | | | | | | | mpfr-longlong.h so that udiv_qrnnd_preinv is defined (this is useful at least on IA64 when compiling without gmp-impl.h). Thanks to Patrick PĂ©lissier for the fix. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7852 280ebfd0-de03-0410-8827-d642c229c3f4
* Make ceil_mul() public as mpfr_ceil_mul() in mpfr-impl.hthevenyp2011-07-281-0/+2
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7760 280ebfd0-de03-0410-8827-d642c229c3f4
* Added mpfr-intmax.h header.vlefevre2011-05-131-16/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7695 280ebfd0-de03-0410-8827-d642c229c3f4
* Started to support mpfr_exp_t defined as intmax_t (_MPFR_EXP_FORMAT==4).vlefevre2011-05-131-0/+20
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7694 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Exponent properties: corrected comments and removedvlefevre2011-05-121-7/+3
| | | | | | obsolete mp_exp_unsigned_t definition (was internal only). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7689 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/{mpfr.h,mpfr-impl.h,vasprintf.c}] Clean-up and improvementvlefevre2011-05-121-8/+13
| | | | | | | | of definitions related to mpfr_exp_t. MPFR can now be built with -D_MPFR_PREC_FORMAT=2 to have mpfr_prec_t and mpfr_exp_t defined as an int. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7688 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Added missing parentheses in MPFR_SADD_OVERFLOWvlefevre2011-05-121-2/+2
| | | | | | (fortunately the current MPFR code was not affected). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7684 280ebfd0-de03-0410-8827-d642c229c3f4
* Fixed constants pi and log(2) computation when logging is used: Whenvlefevre2011-05-111-2/+21
| | | | | | | | | | | | | | MPFR is built with logging support, these two constants are used by the logging functions (via mpfr_fprintf, then mpfr_log, for the base conversion). Since the mpfr_cache function isn't re-entrant when working on the same cache, we need to define two caches for each constant. Otherwise the constants could be incorrect; for instance, "MPFR_LOG_ALL=1 ./tconst_pi" was failing. Note: the bug was introduced with the new logging system from r7575 for MPFR 3.1.0, based on mpfr_fprintf instead of mpfr_out_str (which doesn't depend on mpfr_log). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7678 280ebfd0-de03-0410-8827-d642c229c3f4
* [mpfr-impl.h] fixed typozimmerma2011-05-041-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7663 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] In MPFR_RNDRAW_GEN, do not try to compute thevlefevre2011-05-031-3/+11
| | | | | | | | | sticky bit when not necessary (directed mode with rb = 1). [src/mul.c] FIXME comment: with the change in MPFR_RNDRAW_GEN, uninitialized data are no longer read; there's still something wrong, at least with the code documentation, though. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7661 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] MPFR_RNDRAW_GEN: added other missing parentheses.vlefevre2011-05-031-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7658 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] MPFR_RNDRAW_GEN: added missing parentheses.vlefevre2011-05-031-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7657 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Logging: do not take into account the Ziv loops duevlefevre2011-05-031-2/+9
| | | | | | | to logging (i.e. used by the MPFR functions called by the mpfr_fprintf in LOG_PRINT). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7656 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Avoid recursive logging for MPFR_ZIV_* macros too,vlefevre2011-05-031-27/+48
| | | | | | and fixed type for the output of the precision. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7655 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Avoid recursive logging (not wanted and freezes MPFR).vlefevre2011-05-031-24/+43
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7654 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Avoid a spurious warning with some use of MPFR_BLOCK.vlefevre2011-05-021-0/+4
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7646 280ebfd0-de03-0410-8827-d642c229c3f4
* Get rid of deprecated register_printf_function function in logging system.thevenyp2011-03-171-22/+25
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7575 280ebfd0-de03-0410-8827-d642c229c3f4
* Fixed mpfr_div_2si, mpfr_div_2ui and mpfr_mul_2si in some corner cases.vlefevre2011-02-251-0/+20
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7486 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Defined a MPFR_EXP_FSPEC macro containing thevlefevre2011-02-171-0/+2
| | | | | | | format specifier for mpfr_eexp_t, to output an exponent with: printf ("%" MPFR_EXP_FSPEC "d", (mpfr_eexp_t) exponent); git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7468 280ebfd0-de03-0410-8827-d642c229c3f4
* Added new types mpfr_limb_ptr and mpfr_limb_srcptr to src/mpfr-impl.h,vlefevre2011-02-091-8/+18
| | | | | | | and replaced mp_ptr and mp_srcptr (GMP internals) by these 2 new types respectively. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7455 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Fix for Intel's compiler (ICC) under MS Windows:vlefevre2011-02-081-1/+6
| | | | | | | MPFR was incorrectly assuming that ICC had some extensions like under GNU/Linux. This made the MPFR compilation fail. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7453 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] Corrected a typo in a comment.vlefevre2011-02-081-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7452 280ebfd0-de03-0410-8827-d642c229c3f4
* [src/mpfr-impl.h] In the MPFR_IS_PURE_FP test, if positive, check thatvlefevre2011-01-261-1/+2
| | | | | | | | the number is normalized (debug mode only). This makes 2 tests fail: tcheck and tsum. Note: with logging active, tsum was already triggering an assertion failure in mpfr_get_str (via mpfr_add). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7426 280ebfd0-de03-0410-8827-d642c229c3f4
* Copyright notice update: added 2011 withvlefevre2011-01-171-1/+1
| | | | | | | | perl -pi -e 's/2010 Free Software/2010, 2011 Free Software/' **/*(^/) under zsh, reverting the ChangeLog file and the m4 and tools/mbench directories. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@7389 280ebfd0-de03-0410-8827-d642c229c3f4