summaryrefslogtreecommitdiff
path: root/sub.c
Commit message (Collapse)AuthorAgeFilesLines
* Converted tabs to spaces with expand.vlefevre2005-08-181-49/+49
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3725 280ebfd0-de03-0410-8827-d642c229c3f4
* Change the address of the FSF.pelissip2005-06-021-2/+2
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3606 280ebfd0-de03-0410-8827-d642c229c3f4
* Reindent the code.pelissip2004-12-201-45/+41
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@3155 280ebfd0-de03-0410-8827-d642c229c3f4
* Remove MPFR_ASSERTN(0) and add MPFR_ASSERTD(last condition) instead.pelissip2004-02-121-4/+2
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2696 280ebfd0-de03-0410-8827-d642c229c3f4
* + Add mpfr_add1sp which provides addition when all the operands have the ↵pelissip2004-02-121-2/+10
| | | | | | | | | | | | same precision. + Add new test files for mpfr_copysign and mpfr_min and mpfr_max. + Add test for mpfr_exp10 in tests/texp.c + Improve coverage of div_2ui.c and mul_2ui.c + Add a forgotten ASSERT in mpfr_sqrt git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2686 280ebfd0-de03-0410-8827-d642c229c3f4
* + Better support of non IEEE doubles.pelissip2004-02-061-3/+1
| | | | | | | + You can compile MPFR without gmp internal files (ie gmp-impl.h, gmp-mparam.h, and config.h). You only need gmp.h and libgmp.a. But you can still compile with GMP internal files (configure detects them). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2665 280ebfd0-de03-0410-8827-d642c229c3f4
* Fix copyright lines (2004).pelissip2004-01-071-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2603 280ebfd0-de03-0410-8827-d642c229c3f4
* Fix bug of sub1sp.c on sparck.pelissip2004-01-071-2/+2
| | | | | | | | Add new tests for sub1sp. Reenable sub1sp for mpfr_add / mpfr_sub. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2602 280ebfd0-de03-0410-8827-d642c229c3f4
* Disable sub1sp in add.c and in sub.c since it provides some bugs on spark ↵pelissip2003-12-221-2/+2
| | | | | | (Log/acos/asin and atan tests failed but not tsub or tsub1sp). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2592 280ebfd0-de03-0410-8827-d642c229c3f4
* + Add function mpfr_print_mantissa_binary, for debugging reason.pelissip2003-12-091-2/+6
| | | | | | | | | | | | + Rename MPFR_ALLOC_SIZE in MPFR_MALLOC_SIZE. + Add conditionnal -DSMALL directive in mpfr-impl.h. + Add new function: sub1sp. Substraction in case of all the ops have the same prec. + Add its test (tsub1sp). + Modify a few the tests to avoid comparing mpfr results with double, for portability reason. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2569 280ebfd0-de03-0410-8827-d642c229c3f4
* Fix some bugs (Use MPFR_ASSERT(1) instead of MPFR_ASSERT(0))pelissip2003-11-051-1/+1
| | | | | | | Optimize swap.c and copysign.c. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2536 280ebfd0-de03-0410-8827-d642c229c3f4
* Add a real function for mpfr_sgn (not a call to mpfr_cmp_ui_2exp).pelissip2003-11-051-7/+4
| | | | | | | | | | | Add a test for mpfr_sgn. Change the proto of mpfr_add1 and mpfr_sub1 by removing the last arg. Simplify the logic of the sign in mpfr_sub1. Tiny speed up for cmp/set/sqrt. mpfr-impl auto include all the needed local header files (gmp, gmp-impl, mpfr). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2534 280ebfd0-de03-0410-8827-d642c229c3f4
* + Remove MPFR_CLEAR_NAN and MPFR_CLEAR_INF. Only use MPFR_CLEAR_FLAGS.pelissip2003-11-041-16/+13
| | | | | | | | | | | | | | MPFR_SET_INF, MPFR_SET_ZERO and MPFR_SET_ZERO must clear the flags before setting them. + Add a new test in tacosh.c : check Inf / Nan flags. + Use MPFR_IS_SINGULAR in all the remaining files. + Fix the use of MPFR_CLEAR_FLAGS. + mpfr-impl.h auto include gmp.h, gmp-impl.h, mpfr.h and limits.h. + Rename _PROTO to _MPFR_PROTO, and remove _GMP_PROTO. + Add MPFR_INT_SIGN macro. + Encapsulate a few more the sign. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2529 280ebfd0-de03-0410-8827-d642c229c3f4
* Use of MPFR_UNLIKELY and MPFR_IS_SINGULAR for fast detection of special ↵pelissip2003-10-281-51/+50
| | | | | | | | | values (Nan, Inf or Zero). Start to encapsulate the sign to be independant of the reprensation (Must be 1 or -1). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2525 280ebfd0-de03-0410-8827-d642c229c3f4
* Macros MPFR_EXP_INVALID (invalid exponent value) and MPFR_EXP_CHECKvlefevre2003-05-221-6/+7
| | | | | | | | | | | | added. Code update to use MPFR_GET_EXP and MPFR_SET_EXP instead of MPFR_EXP to allow more bug detection related to special values. Macros MPFR_SET_NAN, MPFR_SET_INF, MPFR_SET_ZERO and MPFR_INIT set the exponent of the number to MPFR_EXP_INVALID if MPFR_EXP_CHECK is defined. Compile with -DMPFR_EXP_CHECK and make check to see the potential problems; currently, 40 of 76 tests fail. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2301 280ebfd0-de03-0410-8827-d642c229c3f4
* fixed wrong inexact flag for a - b where a and b are of different signszimmerma2002-09-261-1/+1
| | | | | | | and EXP(a) < EXP(b) git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@2032 280ebfd0-de03-0410-8827-d642c229c3f4
* Copyright line updated.vlefevre2002-05-141-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1930 280ebfd0-de03-0410-8827-d642c229c3f4
* COPYING -> COPYING.LIB and GPL re-added.vlefevre2002-04-151-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1877 280ebfd0-de03-0410-8827-d642c229c3f4
* COPYING.LIB -> COPYING.vlefevre2002-04-051-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1820 280ebfd0-de03-0410-8827-d642c229c3f4
* Copyright line changed.vlefevre2002-03-041-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1713 280ebfd0-de03-0410-8827-d642c229c3f4
* Optimization: mpfr_cmp2 now accepts any combination of real argumentsvlefevre2002-01-041-97/+56
| | | | | | | | | and computes the sign of |b| - |c| (in addition to the number of cancelled bits); mpfr_add, mpfr_sub, mpfr_sub1, mpfr_agm and some tests updated to take this change into account. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1641 280ebfd0-de03-0410-8827-d642c229c3f4
* changed Library GPL to Lesser GPLzimmerma2001-11-161-4/+4
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1536 280ebfd0-de03-0410-8827-d642c229c3f4
* add.c -> add.c & add1.cvlefevre2001-11-151-401/+0
| | | | | | | sub.c -> sub.c & sub1.c + some changes. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1490 280ebfd0-de03-0410-8827-d642c229c3f4
* fixed pbs with inexact flagzimmerma2001-10-261-16/+26
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1402 280ebfd0-de03-0410-8827-d642c229c3f4
* implemented overflow/underflowzimmerma2001-10-251-5/+33
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1354 280ebfd0-de03-0410-8827-d642c229c3f4
* mpfr_add1 and mpfr_sub1 prototypes moved to mpfr-impl.h (to detect clashes).vlefevre2001-10-191-39/+35
| | | | | | | | Bug fix concerning the inexact ternary value in mpfr_sub. mpfr_add now returns an int (inexact ternary value unsupported if true add). git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1309 280ebfd0-de03-0410-8827-d642c229c3f4
* Comment: // --> /* ... */vlefevre2001-10-161-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1264 280ebfd0-de03-0410-8827-d642c229c3f4
* implemented inexact flagzimmerma2001-10-111-517/+316
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1225 280ebfd0-de03-0410-8827-d642c229c3f4
* Cases where the result is 0 fixed.vlefevre2001-09-061-67/+104
| | | | | | | Integer overflow checked in mpfr_sub. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1166 280ebfd0-de03-0410-8827-d642c229c3f4
* fixed bug for (2^53+4) - 1zimmerma2001-08-231-3/+5
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1139 280ebfd0-de03-0410-8827-d642c229c3f4
* Bugs fixed (particular cases).vlefevre2001-08-221-9/+8
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1128 280ebfd0-de03-0410-8827-d642c229c3f4
* fixed array bound write (bn < an + cancel1 + 1)zimmerma2001-07-061-16/+19
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1103 280ebfd0-de03-0410-8827-d642c229c3f4
* Patch in the case MPFR_PREC(b) > MPFR_PREC(a)+cancel.hanrot2001-05-221-2/+15
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1085 280ebfd0-de03-0410-8827-d642c229c3f4
* fixed new bug found by Nathalie Revol (case when add_one_ulp produces a carry)zimmerma2001-04-181-4/+12
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1079 280ebfd0-de03-0410-8827-d642c229c3f4
* fixed bug for 1.0000... - 0.000001 for rounding up or nearestzimmerma2001-04-181-101/+151
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1077 280ebfd0-de03-0410-8827-d642c229c3f4
* fixed problems with old K&R compilers (_PROTO missing)zimmerma2001-02-151-2/+2
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@987 280ebfd0-de03-0410-8827-d642c229c3f4
* fixed bug when c does not overlap with a, b is negative and GMP_RNDNzimmerma2000-12-221-6/+16
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@934 280ebfd0-de03-0410-8827-d642c229c3f4
* k2r -> ansi stylezimmerma2000-12-211-1/+5
| | | | | | | | removed #include <math.h> by defining auxiliary functions fixed several tiny remaining bugs with NaN/Inf git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@925 280ebfd0-de03-0410-8827-d642c229c3f4
* changed name of mpfr struct fields: _mp_d -> _mpfr_dzimmerma2000-12-181-1/+2
| | | | | | | | | (to detect conflicts with mpf) fixed a few problems in non-STDC headers moved definitions of mpfr-impl.h to mpfr-test.h and created a real mpfr-impl.h git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@897 280ebfd0-de03-0410-8827-d642c229c3f4
* adapted to NaN/Infzimmerma2000-12-151-6/+16
| | | | | | | removed warnings git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@888 280ebfd0-de03-0410-8827-d642c229c3f4
* Permutation of includes to avoid warnings due to careless multiple definitionhanrot2000-12-151-1/+1
| | | | | | | of ULONG_MAX. git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@862 280ebfd0-de03-0410-8827-d642c229c3f4
* changed copyright to Free Software Foundationzimmerma2000-12-011-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@816 280ebfd0-de03-0410-8827-d642c229c3f4
* fixed potential problem in mpfr_sub1 (k=0 and kc<0)zimmerma2000-11-291-1/+2
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@805 280ebfd0-de03-0410-8827-d642c229c3f4
* forgot cast to int before comparison between imax (can be negative) and anzimmerma2000-11-281-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@803 280ebfd0-de03-0410-8827-d642c229c3f4
* fixed bug when imax>anzimmerma2000-11-281-3/+4
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@796 280ebfd0-de03-0410-8827-d642c229c3f4
* Infinis, premiere tentative.hanrot2000-11-211-0/+25
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@793 280ebfd0-de03-0410-8827-d642c229c3f4
* protected all macros: xxx -> MPFR_xxxzimmerma2000-10-261-50/+50
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@786 280ebfd0-de03-0410-8827-d642c229c3f4
* fixed another ABW bugzimmerma2000-09-281-1/+3
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@760 280ebfd0-de03-0410-8827-d642c229c3f4
* fixed two Array Bound Writeszimmerma2000-09-281-2/+2
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@759 280ebfd0-de03-0410-8827-d642c229c3f4
* fixed Array Bound Writezimmerma2000-09-271-1/+1
| | | | git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@755 280ebfd0-de03-0410-8827-d642c229c3f4