debian/0000755000000000000000000000000012231135713007164 5ustar debian/compat0000644000000000000000000000000212231134444010362 0ustar 7 debian/changelog0000644000000000000000000004360112231135555011046 0ustar mpfr4 (3.1.2-1) unstable; urgency=low * New upstream release. * Apply upstream's patches 01 through 03 (closes: #726268). * Use -O1 for sh4 (closes: #726602). -- Laurent Fousse Sun, 20 Oct 2013 21:37:43 -0700 mpfr4 (3.1.1-2) unstable; urgency=low * Remove lib32mpfr{4,-dev} packages. Closes: #718094. -- Steve M. Robbins Sun, 18 Aug 2013 22:24:02 -0500 mpfr4 (3.1.1-1) unstable; urgency=low * New upstream release. * Use dh-autoreconf, as suggested by Colin Watson (closes: #700065). -- Laurent Fousse Mon, 18 Feb 2013 18:20:45 -0800 mpfr4 (3.1.0-5) unstable; urgency=low * Apply upstream patch 04 through 10, fixing various miscomputation, freezes, and compatibility issues with newer GMP version. -- Laurent Fousse Tue, 08 May 2012 04:35:31 +0000 mpfr4 (3.1.0-4) unstable; urgency=low * Re-enable TLS on sparc now that we have binutils >= 2.22 (closes: #645587). -- Laurent Fousse Sat, 03 Mar 2012 19:02:41 -0800 mpfr4 (3.1.0-3) unstable; urgency=low * Apply upstream patch01, fixing bug in MPFR_UNLIKELY. * Apply upstream patch03, fixing bug in the mpfr_*printf functions (closes: #648213). -- Laurent Fousse Wed, 09 Nov 2011 20:51:05 +0100 mpfr4 (3.1.0-2) unstable; urgency=low * Disable TLS support on sparc (closes: #644552). This is an ugly workaround for what is quite likely a compiler optimization bug. -- Laurent Fousse Sat, 08 Oct 2011 23:38:48 +0200 mpfr4 (3.1.0-1) unstable; urgency=low * New upstream release. -- Laurent Fousse Mon, 03 Oct 2011 20:34:02 +0200 mpfr4 (3.1.0~rc2-1) experimental; urgency=low * New upstream release candidate. -- Laurent Fousse Thu, 22 Sep 2011 09:41:06 +0200 mpfr4 (3.0.1-6) unstable; urgency=low * Add Multi-Arch support, thanks Riku Voipio for the patch (closes: #638958). -- Laurent Fousse Tue, 23 Aug 2011 13:05:43 +0200 mpfr4 (3.0.1-5) unstable; urgency=low * Remove .la files (closes: #633200). * Register documentation with doc-base. * Misc improvements to make lintian happier. * Upgraded Standards-Version to 3.9.2 (no change needed). -- Laurent Fousse Mon, 18 Jul 2011 14:51:32 +0200 mpfr4 (3.0.1-4) unstable; urgency=low * Correct PATCHES file, thanks Vincent Lefevre (closes: #630782). -- Laurent Fousse Tue, 28 Jun 2011 09:45:12 +0200 mpfr4 (3.0.1-3) unstable; urgency=low * Apply upstream patch "atan-expo-range" (patch03), closes: #625665 -- Laurent Fousse Thu, 05 May 2011 08:04:50 +0200 mpfr4 (3.0.1-2) unstable; urgency=low * Apply upstream rec_sqrt-carry patch (patch02). -- Laurent Fousse Wed, 04 May 2011 14:44:56 +0200 mpfr4 (3.0.1-1) unstable; urgency=low * New upstream release. * Apply upstream asin_exprange patch (patch01). -- Laurent Fousse Thu, 28 Apr 2011 11:32:37 +0200 mpfr4 (3.0.1~rc1-1) experimental; urgency=low * New upstream release candidate. -- Laurent Fousse Sat, 19 Mar 2011 10:33:12 +0100 mpfr4 (3.0.0-9) unstable; urgency=low * Use unversioned build-depends on libgmp-dev. * Upgraded Standards-Version to 3.9.1 (no change needed). -- Laurent Fousse Sun, 06 Mar 2011 19:56:13 +0100 mpfr4 (3.0.0-8) experimental; urgency=low * Build with libgmp10 (closes: #614499). * Modify my email address. -- Laurent Fousse Tue, 22 Feb 2011 10:02:32 +0100 mpfr4 (3.0.0-7) unstable; urgency=low * Build a -dbg package (closes: #595948). -- Laurent Fousse Mon, 21 Feb 2011 08:54:59 +0100 mpfr4 (3.0.0-6) unstable; urgency=low * Include AUTHORS file (closes: #611110). * Upload to unstable. * Apply upstream patch 08, fixes macro issues (closes: #602980). -- Laurent Fousse Wed, 16 Feb 2011 14:04:18 +0100 mpfr4 (3.0.0-5) experimental; urgency=low * Apply upstream patches 05 through 07: + fixes tcan_round (patch05) + fixes subtraction code (patch06) + fixes mpfr_set_ld (patch07). -- Laurent Fousse Wed, 27 Oct 2010 19:54:55 +0200 mpfr4 (3.0.0-4) experimental; urgency=low * Apply upstream patch04 (closes: #595959). -- Laurent Fousse Tue, 07 Sep 2010 19:13:25 +0200 mpfr4 (3.0.0-3) experimental; urgency=low * Build 32 bit package on 64 bit archs (closes: #583708). -- Laurent Fousse Fri, 23 Jul 2010 14:12:11 +0200 mpfr4 (3.0.0-2) unstable; urgency=low * Apply 3 upstream patches, fixing: + incorrect return value of `mpfr_out_str' (patch01) + problem with `alloca' on some plateform (patch02) + underflow management in `mpfr_gamma' (patch03). * Upload to unstable. -- Laurent Fousse Tue, 13 Jul 2010 14:05:04 +0200 mpfr4 (3.0.0-1) experimental; urgency=low * New upstream release. -- Laurent Fousse Thu, 10 Jun 2010 15:08:20 +0200 mpfr4 (3.0.0~rc2-2) experimental; urgency=low * Fix almost empty doc package. * Include code samples in libmpfr-doc. -- Laurent Fousse Thu, 10 Jun 2010 13:39:10 +0200 mpfr4 (3.0.0~rc2-1) experimental; urgency=low * New release candidate. -- Laurent Fousse Sun, 06 Jun 2010 22:41:05 +0200 mpfr4 (3.0.0~rc1-4) experimental; urgency=low * Rename libmpfr4-doc to libmpfr-doc. -- Laurent Fousse Thu, 03 Jun 2010 11:35:02 +0200 mpfr4 (3.0.0~rc1-3) experimental; urgency=low * Rename libmpfr4-dev to libmpfr-dev, it makes more sense for the upgrade. * Correct old lib name in description. -- Laurent Fousse Wed, 02 Jun 2010 10:01:07 +0200 mpfr4 (3.0.0~rc1-2) experimental; urgency=low * Update debian/copyright to reflect the change to LGPL3+, thanks Torsten Werner. -- Laurent Fousse Thu, 27 May 2010 20:39:36 +0200 mpfr4 (3.0.0~rc1-1) experimental; urgency=low * Switch to dpkg-source 3.0 (quilt) format * New release candidate (closes: #583205). * New source package because: + soversion has changed + gcc build-depends on mpfr. -- Laurent Fousse Wed, 26 May 2010 17:58:44 +0200 mpfr (2.4.2-3) unstable; urgency=low * Apply patch by Aurélien Jarno, fixing compilation problem on mips(el) with gcc-4.4 (closes: #560221). -- Laurent Fousse Wed, 09 Dec 2009 21:49:52 +0100 mpfr (2.4.2-2) unstable; urgency=low * Apply patch `sin_cos_underflow', fixes underflow problems in mpfr_sin_cos. -- Laurent Fousse Tue, 08 Dec 2009 09:46:13 +0100 mpfr (2.4.2-1) unstable; urgency=low * New upstream release. -- Laurent Fousse Mon, 30 Nov 2009 13:32:20 +0100 mpfr (2.4.2~rc3-1) experimental; urgency=low * New upstream release candidate. -- Laurent Fousse Wed, 25 Nov 2009 18:40:54 +0100 mpfr (2.4.2~rc2-1) experimental; urgency=low * New upstream release candidate. -- Laurent Fousse Sun, 22 Nov 2009 12:59:41 +0100 mpfr (2.4.2~rc1-1) experimental; urgency=low * New upstream release candidate. * Add missing ${misc:Depends}. * Add missing dependency on install-info. * DH_COMPAT upgraded to 7. * Upgraded Standards-Version to 3.8.3. -- Laurent Fousse Thu, 03 Sep 2009 14:42:25 +0200 mpfr (2.4.1-2) unstable; urgency=low * Apply patch by Nobuhiro Iwamatsu for sh4 support (closes: #459598). -- Laurent Fousse Sat, 30 May 2009 13:58:38 +0200 mpfr (2.4.1-1) unstable; urgency=low * New upstream release. * Apply patch01 and patch02: + fix incorrect rounding in remainder functions + explicit assert message. -- Laurent Fousse Fri, 06 Mar 2009 11:50:58 +0100 mpfr (2.4.0-5) unstable; urgency=low * Apply patches 01 and 02: + check for printf length modifiers hh and ll at configure + fix potential buffer overflow problem in mpfr_snprintf and mpfr_vsnprintf. -- Laurent Fousse Wed, 25 Feb 2009 17:38:23 +0100 mpfr (2.4.0-4) unstable; urgency=low * Upload to unstable. -- Laurent Fousse Mon, 16 Feb 2009 19:06:21 +0100 mpfr (2.4.0-3) experimental; urgency=low * Build-depend on texlive-latex-base (closes: #514340). -- Laurent Fousse Thu, 12 Feb 2009 15:34:11 +0100 mpfr (2.4.0-2) experimental; urgency=low * Build-depend on texinfo (closes: #514340). -- Laurent Fousse Sun, 08 Feb 2009 11:11:11 +0100 mpfr (2.4.0-1) experimental; urgency=low * New upstream release. * Documentation is now free, in new libmpfr-doc package. -- Laurent Fousse Sun, 01 Feb 2009 14:15:48 +0100 mpfr (2.3.2.dfsg.1-1) unstable; urgency=low * New upstream release (closes: #501967). * Removed C++ interface. * Upgraded Standards-Version to 3.8.0, no change needed. -- Laurent Fousse Sun, 12 Oct 2008 11:51:30 +0200 mpfr (2.3.1.dfsg.1-2) unstable; urgency=low * Partially import diff from Ubuntu, thanks to Matthias Klose: + Run dh_install with -s -i. + Build 64bit packages for powerpc. + Build with srcdir != builddir. + Support `parallel' and `nocheck' in DEB_BUILD_OPTIONS. + Use debian/*.install files, as --autodest doesn't work with biarch. Note that the 64bit package is currently disabled for powerpc since GMP is not yet available. * Added missing ${shlibs:Depends}, found by Niko Tyni. -- Laurent Fousse Tue, 29 Jan 2008 15:08:44 +0100 mpfr (2.3.1.dfsg.1-1) unstable; urgency=low * New upstream release. -- Laurent Fousse Tue, 29 Jan 2008 14:51:30 +0100 mpfr (2.3.0.dfsg.1-2) unstable; urgency=low * Fixed libmpfr1ldbl's Conflicts/Replaces control fields (closes: #440125). -- Laurent Fousse Thu, 30 Aug 2007 10:13:54 +0200 mpfr (2.3.0.dfsg.1-1) unstable; urgency=low * New upstream release. -- Laurent Fousse Wed, 29 Aug 2007 15:12:31 +0200 mpfr (2.3.0~rc1.dfsg.1-2) unstable; urgency=low * Import mpfr_cos fix from upstream's r4630 (closes: #433773). -- Laurent Fousse Wed, 18 Jul 2007 23:46:16 +0200 mpfr (2.3.0~rc1.dfsg.1-1) unstable; urgency=low * New upstream release candidate. -- Laurent Fousse Wed, 18 Jul 2007 15:05:11 +0200 mpfr (2.2.1.dfsg.1-3) unstable; urgency=low * Rename libmpfr1 to libmpfr1ldbl (closes: #430273). -- Laurent Fousse Tue, 17 Jul 2007 15:34:00 +0200 mpfr (2.2.1.dfsg.1-2) unstable; urgency=low * Now that etch is released, upload to unstable. -- Laurent Fousse Wed, 11 Apr 2007 13:57:29 +0200 mpfr (2.2.1.dfsg.1-1) experimental; urgency=low * New upstream release (closes: #401946). -- Laurent Fousse Sun, 17 Dec 2006 22:01:14 +0100 mpfr (2.2.0.dfsg.1-8) unstable; urgency=low * Newer gcc should be able to compile mpfr on m68k, so drop the dependancy on gcc-3.4 (closes: #378356). Thanks Stephen R Marenka for testing. * Don't try to use GMP's internal header files anymore: we didn't have them all anyway, and they're not strictly needed. * Upgraded Standards-Version to 3.7.2, no change needed. -- Laurent Fousse Tue, 18 Jul 2006 15:35:53 +0200 mpfr (2.2.0.dfsg.1-7) unstable; urgency=low * Apply upstream patches 09 to 12: + small bugfix in random2 (patch09) + more C99-compliant macros (patch10) + potential miscomputation bug in division (patch11) + another bug in mpfr_get_f (patch12) * Don't use longlong.h on hppa, seems buggy as well (closes: #373761). -- Laurent Fousse Sat, 17 Jun 2006 21:53:07 +0200 mpfr (2.2.0.dfsg.1-6) unstable; urgency=low * Don't use buggy longlong.h on s390 (closes: #363287). -- Laurent Fousse Tue, 18 Apr 2006 14:49:05 +0200 mpfr (2.2.0.dfsg.1-5) unstable; urgency=low * Tighten dependancy to libgmp3c2 because of the __gmp_rand symbol in recent GMP (closes: #362837). -- Laurent Fousse Mon, 17 Apr 2006 23:23:22 +0200 mpfr (2.2.0.dfsg.1-4) unstable; urgency=low * Restrict Build-Depends on gcc-3.4 for m68k only (closes: #353137). * Applied upstream patches 04 to 08 (03 is not relevant): + patch04 removes call to fabs, + patch05 fixes several problems including an incorrect rounding bug, + patch06 fixes a poor efficiency issue in the division, + patch07 fixes rounding errors in mpfr_sin, + patch08 fixes incorrect value error in some cases for mpfr_set_f and mpfr_get_f. -- Laurent Fousse Sat, 18 Feb 2006 10:57:08 +0100 mpfr (2.2.0.dfsg.1-3) unstable; urgency=low * Build with gcc-3.4 and -O0 on m68k as is was tested to produce something that at least passes the tests (closes: #338087). -- Laurent Fousse Wed, 30 Nov 2005 15:06:41 +0100 mpfr (2.2.0.dfsg.1-2) unstable; urgency=low * Add support for shared library: + shared library is in new package libmpfr1. * Change "exact rounding" to "correct rounfing" in package description, following upstream decision. -- Laurent Fousse Tue, 1 Nov 2005 09:55:32 +0100 mpfr (2.2.0.dfsg.1-1) unstable; urgency=low * New upstream release * Repackaged source tarball to remove GFDL doc mpfr.texi (closes: #328227). Removed fdl.texi as well, it is no longer relevant to the package. One run of `autoreconf' was needed, hence the huge debian diff. * Applied upstream patch 01 and 02, fixes bugs in lngamma and mpfr_set_ui. -- Laurent Fousse Thu, 29 Sep 2005 17:12:54 +0200 mpfr (2.1.2-1) unstable; urgency=low * New upstream release. * Updated copyright file to include current year too. -- Laurent Fousse Sun, 14 Aug 2005 21:51:06 +0200 mpfr (2.1.1-11) unstable; urgency=low * Applied upstream patch 11, fixes locale-dependant parsing error. * Upgraded Standards-Version to 3.6.2, no change needed. -- Laurent Fousse Tue, 12 Jul 2005 08:55:30 +0200 mpfr (2.1.1-10) unstable; urgency=low * Applied upstream patch 10, fixes zero sign error in mpfr_atan. -- Laurent Fousse Tue, 5 Jul 2005 15:52:03 +0200 mpfr (2.1.1-9) unstable; urgency=low * Applied upstream patch 09, fixes miscomputation errors in some special cases. * Switch places (Maintainer <--> Uploader) with Steve as discussed privately with him. -- Laurent Fousse Thu, 9 Jun 2005 10:41:41 +0200 mpfr (2.1.1-8) unstable; urgency=low * Added C++ interface header. -- Laurent Fousse Fri, 20 May 2005 11:21:22 +0200 mpfr (2.1.1-7) unstable; urgency=low * Applied upstream patch 08, fixes infinite loop in mpfr_hypot. -- Laurent Fousse Thu, 12 May 2005 20:33:09 +0200 mpfr (2.1.1-6) unstable; urgency=low * Applied upstream patch 07, fixes computation error in mpfr_div_ui. -- Laurent Fousse Fri, 6 May 2005 13:30:09 +0200 mpfr (2.1.1-5) unstable; urgency=low * Applied upstream patch 05 and 06, fixes computation error in mpfr_get_ld and mpfr_set_ld. -- Laurent Fousse Fri, 22 Apr 2005 17:03:52 +0200 mpfr (2.1.1-4) unstable; urgency=low * Applied upstream patch 04, fixes computation error in mpfr_pow_ui. -- Laurent Fousse Wed, 6 Apr 2005 09:40:35 +0200 mpfr (2.1.1-3) unstable; urgency=low * Applied upstream patch 03, fixes computation error in mpfr_atanh. -- Laurent Fousse Mon, 21 Mar 2005 09:44:53 +0100 mpfr (2.1.1-2) unstable; urgency=low * Applied upstream patches 01 and 02, fixes computation error. -- Laurent Fousse Wed, 9 Mar 2005 16:55:47 +0100 mpfr (2.1.1-1) unstable; urgency=low * New upstream release. -- Laurent Fousse Wed, 23 Feb 2005 17:26:32 +0100 mpfr (2.1.0-7) unstable; urgency=low * Applied upstream patch #15 and #16, fixes infinite loop for some computations. -- Laurent Fousse Wed, 16 Feb 2005 13:25:42 +0100 mpfr (2.1.0-6) unstable; urgency=low * Applied upstream patch #14, fixes possible computation error. -- Laurent Fousse Tue, 15 Feb 2005 10:33:40 +0100 mpfr (2.1.0-5) unstable; urgency=low * Applied upstream patch #13, fixes bug introduced in patch #12. * Tests are now randomized. -- Laurent Fousse Thu, 3 Feb 2005 10:50:46 +0100 mpfr (2.1.0-4) unstable; urgency=low * Upstream issued a new bugfix patch. This build includes patch 01 through 12 from http://mpfr.org/mpfr-current/#bugs. -- Laurent Fousse Sat, 29 Jan 2005 13:15:14 +0100 mpfr (2.1.0-3) unstable; urgency=low * Apply bugfix patches found on http://www.mpfr.org/mpfr-2.1.0/#bugs, thanks Vincent Lefevre. Closes: #292649. -- Laurent Fousse Fri, 28 Jan 2005 16:58:00 +0100 mpfr (2.1.0-2) unstable; urgency=low * Added conflict with libgmp3-doc (<< 4.1.4-3), needed for mpfr.info. Closes: #279589. -- Laurent Fousse Fri, 5 Nov 2004 09:42:30 +0100 mpfr (2.1.0-1) unstable; urgency=low * New upstream release -- Laurent Fousse Wed, 3 Nov 2004 17:42:49 +0100 mpfr (2.0.3-2) unstable; urgency=low * sqrt.c: Replace with fixed version from http://www.mpfr.org/mpfr-current/sqrt.c. * acinclude.m4: Add test for "union fpc_csr". Re-run autoconf and automake. * tests/test.c: Change "#ifdef __mips" to "#if HAVE_FPC_CSR". Closes: #278202. -- Steve M. Robbins Mon, 25 Oct 2004 22:52:07 -0400 mpfr (2.0.3-1) unstable; urgency=low * First debian packaging. Closes: #276085. -- Steve M. Robbins Thu, 14 Oct 2004 00:07:27 -0400 debian/README.Debian0000644000000000000000000000054712231134444011233 0ustar C++ interface ------------- We used to ship a C++ interface, but it has been broken for some time. MPFR Documentation ------------------ The documentation of MPFR is licensed under the GFDL which is considered non-free by the debian project, and has been removed from this package. -- Laurent Fousse , Sun, 12 Oct 2008 16:58:22 +0200 debian/libmpfr-doc.doc-base0000644000000000000000000000062712231134444012766 0ustar Document: mpfr-manual Title: MPFR library documentation Abstract: Official MPFR documentation from the MPFR developers. Section: Programming/C Format: HTML Index: /usr/share/doc/libmpfr-doc/mpfr.html/index.html Files: /usr/share/doc/libmpfr-doc/mpfr.html/*.html Format: PDF Files: /usr/share/doc/libmpfr-doc/mpfr.pdf.gz Format: Info Index: /usr/share/info/mpfr.info.gz Files: /usr/share/info/mpfr.info.gzdebian/watch0000644000000000000000000000007712231134627010224 0ustar version=3 http://www.mpfr.org/mpfr-current/ mpfr-(.+).tar.gz debian/rules0000755000000000000000000000765312231135555010263 0ustar #!/usr/bin/make -f # Sample debian/rules that uses debhelper. # This file is public domain software, originally written by Joey Hess. # # This version is for a multibinary package. It also allows you to build any # of the binary packages independantly, via binary- targets. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 with_check := yes ifneq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS))) with_check := disabled through DEB_BUILD_OPTIONS endif NJOBS = # Support parallel= in DEB_BUILD_OPTIONS (see #209008) ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) COMMA = , NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) endif # This has to be exported to make some magic below work. export DH_OPTIONS DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH) export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) confflags += --build $(DEB_HOST_GNU_TYPE) else confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE) endif export CFLAGS = -g export LDFLAGS = -Wl,-z,defs ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else ifeq (m68k,$(DEB_HOST_ARCH)) CFLAGS += -O0 else ifeq (sh4,$(DEB_HOST_ARCH)) CFLAGS += -O1 -mieee else CFLAGS += -O3 endif endif endif # Re-enable TLS on sparc. # ifeq (sparc,$(DEB_HOST_ARCH)) # confflags += --disable-thread-safe # endif build-doc: configure-stamp $(MAKE) -C build pdf info html autoreconf-stamp: dh_autoreconf touch $@ configure: configure-stamp configure-stamp: autoreconf-stamp dh_testdir rm -rf build mkdir -p build chmod +x configure cd build && \ ../configure $(confflags) --prefix=/usr \ --enable-shared --libdir=/usr/lib/$(DEB_HOST_MULTIARCH) touch configure-stamp build-stamp: configure-stamp dh_testdir $(MAKE) $(NJOBS) -C build ifeq ($(with_check),yes) ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE)) GMP_CHECK_RANDOMIZE=1 $(MAKE) -C build check endif endif touch build-stamp build-indep: build-stamp build-arch: build-stamp build: build-indep build-arch clean: dh_autoreconf_clean rm -f autoreconf-stamp dh_testdir dh_testroot rm -f *-stamp rm -rf build dh_clean install: DH_OPTIONS= install: build dh_testdir dh_testroot dh_prep dh_clean dh_installdirs $(MAKE) -C build DESTDIR=`pwd`/debian/tmp install # Miscellaneous install. dh_install -i dh_install -plibmpfr4 dh_install -plibmpfr-dev dh_makeshlibs -v -V -plibmpfr4 # This single target is used to build all the packages, all at once, or # one at a time. So keep in mind: any options passed to commands here will # affect _all_ packages. Anything you want to only affect one package # should be put in another target, such as the install target. binary-common: dh_testdir dh_testroot dh_installchangelogs ChangeLog dh_installdocs -A BUGS NEWS README TODO AUTHORS dh_installexamples dh_installmenu dh_installinfo dh_strip --dbg-package=libmpfr4-dbg dh_link dh_compress dh_fixperms dh_lintian dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb # Build architecture independant packages using the common target. binary-indep: build build-doc install # (Uncomment this next line if you have such packages.) $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common # Build architecture dependant packages using the common target. binary-arch: build install $(EXTRA_INSTALL) $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common # Any other binary targets build just one binary package at a time. binary-%: build install make -f debian/rules binary-common DH_OPTIONS=-p$* binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary-common binary install build-arch build-indep debian/libmpfr1ldbl.lintian-overrides0000644000000000000000000000006012231134444015112 0ustar libmpfr1ldbl: package-name-doesnt-match-sonames debian/libmpfr-dev.install0000644000000000000000000000010712231134444012761 0ustar usr/lib/*/libmpfr.so usr/lib/*/libmpfr.a usr/include/*.h usr/include/ debian/control0000644000000000000000000000517412231134627010601 0ustar Source: mpfr4 Section: math Priority: optional Build-Depends: debhelper (>= 8.1.3), libgmp-dev, dh-autoreconf Build-Depends-Indep: texinfo, texlive-latex-base Maintainer: Laurent Fousse Uploaders: Steve M. Robbins , Philipp Matthias Hahn Homepage: http://www.mpfr.org/ Vcs-Git: git://git.debian.org/collab-maint/mpfr.git Vcs-Browser: http://git.debian.org/?p=collab-maint/mpfr.git Standards-Version: 3.9.2 Package: libmpfr4 Section: libs Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Pre-Depends: ${misc:Pre-Depends} Multi-Arch: same Conflicts: libgmp3 (<< 4.1.4-3) Description: multiple precision floating-point computation MPFR provides a library for multiple-precision floating-point computation with correct rounding. The computation is both efficient and has a well-defined semantics. It copies the good ideas from the ANSI/IEEE-754 standard for double-precision floating-point arithmetic (53-bit mantissa). Package: libmpfr4-dbg Section: debug Priority: extra Architecture: any Depends: libmpfr4 (= ${binary:Version}), ${misc:Depends} Description: multiple precision floating-point computation (debug symbols) MPFR provides a library for multiple-precision floating-point computation with correct rounding. The computation is both efficient and has a well-defined semantics. It copies the good ideas from the ANSI/IEEE-754 standard for double-precision floating-point arithmetic (53-bit mantissa). . This package contains the debugging symbols for libmpfr4. Package: libmpfr-dev Section: libdevel Architecture: any Depends: libgmp-dev, libmpfr4 (= ${binary:Version}), ${misc:Depends} Multi-Arch: same Suggests: libmpfr-doc Conflicts: libgmp3-dev (<< 4.1.4-3) Replaces: libgmp3-dev (<< 4.1.4-3) Description: multiple precision floating-point computation developers tools This development package provides the header files and the symbolic links to allow compilation and linking of programs that use the libraries provided in the libmpfr4 package. . MPFR provides a library for multiple-precision floating-point computation with correct rounding. The computation is both efficient and has a well-defined semantics. It copies the good ideas from the ANSI/IEEE-754 standard for double-precision floating-point arithmetic (53-bit mantissa). Package: libmpfr-doc Section: doc Architecture: all Depends: dpkg (>= 1.15.4) | install-info, ${misc:Depends} Description: multiple precision floating-point computation documentation This package provides documentation for the multiple-precision floating-point computation library MPFR. . The documentation is available as html and PDF. debian/copyright0000644000000000000000000000160412231134444011120 0ustar MPFR was downloaded from http://www.mpfr.org/. Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by the Arenaire and Cacao projects, INRIA. The GNU MPFR Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License (either version 3 of the License, or, at your option, any later version). For the documentation, this terms apply: Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. On Debian systems, a copy of the license is located in files /usr/share/common-licenses/LGPL-3 and /usr/share/common-licenses/GFDL. debian/patches/0000755000000000000000000000000012231135546010617 5ustar debian/patches/0001-Apply-upstream-s-patch-exp_2.patch0000644000000000000000000000326512231135546017517 0ustar From: Laurent Fousse Date: Sun, 20 Oct 2013 21:43:18 -0700 Subject: Apply upstream's patch "exp_2". --- PATCHES | 1 + VERSION | 2 +- src/exp_2.c | 2 +- src/mpfr.h | 2 +- src/version.c | 2 +- 5 files changed, 5 insertions(+), 4 deletions(-) diff --git a/PATCHES b/PATCHES index e69de29..9369ba3 100644 --- a/PATCHES +++ b/PATCHES @@ -0,0 +1 @@ +exp_2 diff --git a/VERSION b/VERSION index ef538c2..cabbaf0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.1.2 +3.1.2-p1 diff --git a/src/exp_2.c b/src/exp_2.c index 7f9ef6f..2d8f75a 100644 --- a/src/exp_2.c +++ b/src/exp_2.c @@ -204,7 +204,7 @@ mpfr_exp_2 (mpfr_ptr y, mpfr_srcptr x, mpfr_rnd_t rnd_mode) for (k = 0; k < K; k++) { mpz_mul (ss, ss, ss); - exps <<= 1; + exps *= 2; exps += mpz_normalize (ss, ss, q); } mpfr_set_z (s, ss, MPFR_RNDN); diff --git a/src/mpfr.h b/src/mpfr.h index a3241dc..ffa03ce 100644 --- a/src/mpfr.h +++ b/src/mpfr.h @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #define MPFR_VERSION_MAJOR 3 #define MPFR_VERSION_MINOR 1 #define MPFR_VERSION_PATCHLEVEL 2 -#define MPFR_VERSION_STRING "3.1.2" +#define MPFR_VERSION_STRING "3.1.2-p1" /* Macros dealing with MPFR VERSION */ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c)) diff --git a/src/version.c b/src/version.c index 1ae4fe2..c56626d 100644 --- a/src/version.c +++ b/src/version.c @@ -25,5 +25,5 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., const char * mpfr_get_version (void) { - return "3.1.2"; + return "3.1.2-p1"; } debian/patches/0002-Apply-upstream-s-patch-fits-smallneg.patch0000644000000000000000000004472312231135546021254 0ustar From: Laurent Fousse Date: Sun, 20 Oct 2013 22:23:33 -0700 Subject: Apply upstream's patch "fits-smallneg". --- PATCHES | 1 + VERSION | 2 +- src/fits_u.h | 19 ++- src/fits_uintmax.c | 54 ++----- src/mpfr.h | 2 +- src/version.c | 2 +- tests/tfits.c | 460 ++++++++++++++++++++++++++++------------------------- 7 files changed, 273 insertions(+), 267 deletions(-) diff --git a/PATCHES b/PATCHES index 9369ba3..7f9bcc2 100644 --- a/PATCHES +++ b/PATCHES @@ -1 +1,2 @@ exp_2 +fits-smallneg diff --git a/VERSION b/VERSION index cabbaf0..cde8847 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.1.2-p1 +3.1.2-p2 diff --git a/src/fits_u.h b/src/fits_u.h index ab4715f..4c90fa1 100644 --- a/src/fits_u.h +++ b/src/fits_u.h @@ -32,17 +32,20 @@ FUNCTION (mpfr_srcptr f, mpfr_rnd_t rnd) int res; if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (f))) - /* Zero always fit */ - return MPFR_IS_ZERO (f) ? 1 : 0; - else if (MPFR_IS_NEG (f)) - /* Negative numbers don't fit */ - return 0; - /* now it fits if - (a) f <= MAXIMUM - (b) round(f, prec(slong), rnd) <= MAXIMUM */ + return MPFR_IS_ZERO (f) ? 1 : 0; /* Zero always fits */ e = MPFR_GET_EXP (f); + if (MPFR_IS_NEG (f)) + return e >= 1 ? 0 /* f <= -1 does not fit */ + : rnd != MPFR_RNDN ? MPFR_IS_LIKE_RNDU (rnd, -1) /* directed mode */ + : e < 0 ? 1 /* f > -1/2 fits in MPFR_RNDN */ + : mpfr_powerof2_raw(f); /* -1/2 fits, -1 < f < -1/2 don't */ + + /* Now it fits if + (a) f <= MAXIMUM + (b) round(f, prec(slong), rnd) <= MAXIMUM */ + /* first compute prec(MAXIMUM); fits in an int */ for (s = MAXIMUM, prec = 0; s != 0; s /= 2, prec ++); diff --git a/src/fits_uintmax.c b/src/fits_uintmax.c index 43a9ca9..26c9773 100644 --- a/src/fits_uintmax.c +++ b/src/fits_uintmax.c @@ -27,51 +27,19 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-intmax.h" #include "mpfr-impl.h" -#ifdef _MPFR_H_HAVE_INTMAX_T - -/* We can't use fits_u.h <= mpfr_cmp_ui */ -int -mpfr_fits_uintmax_p (mpfr_srcptr f, mpfr_rnd_t rnd) -{ - mpfr_exp_t e; - int prec; - uintmax_t s; - mpfr_t x; - int res; - - if (MPFR_UNLIKELY (MPFR_IS_SINGULAR (f))) - /* Zero always fit */ - return MPFR_IS_ZERO (f) ? 1 : 0; - else if (MPFR_IS_NEG (f)) - /* Negative numbers don't fit */ - return 0; - /* now it fits if - (a) f <= MAXIMUM - (b) round(f, prec(slong), rnd) <= MAXIMUM */ - - e = MPFR_GET_EXP (f); +/* Note: though mpfr-impl.h is included in fits_u.h, we also include it + above so that it gets included even when _MPFR_H_HAVE_INTMAX_T is not + defined; this is necessary to avoid an empty translation unit, which + is forbidden by ISO C. Without this, a failing test can be reproduced + by creating an invalid stdint.h somewhere in the default include path + and by compiling MPFR with "gcc -ansi -pedantic-errors". */ - /* first compute prec(MAXIMUM); fits in an int */ - for (s = MPFR_UINTMAX_MAX, prec = 0; s != 0; s /= 2, prec ++); - - /* MAXIMUM needs prec bits, i.e. MAXIMUM = 2^prec - 1 */ - - /* if e <= prec - 1, then f < 2^(prec-1) < MAXIMUM */ - if (e <= prec - 1) - return 1; - - /* if e >= prec + 1, then f >= 2^prec > MAXIMUM */ - if (e >= prec + 1) - return 0; +#ifdef _MPFR_H_HAVE_INTMAX_T - MPFR_ASSERTD (e == prec); +#define FUNCTION mpfr_fits_uintmax_p +#define MAXIMUM MPFR_UINTMAX_MAX +#define TYPE uintmax_t - /* hard case: first round to prec bits, then check */ - mpfr_init2 (x, prec); - mpfr_set (x, f, rnd); - res = MPFR_GET_EXP (x) == e; - mpfr_clear (x); - return res; -} +#include "fits_u.h" #endif diff --git a/src/mpfr.h b/src/mpfr.h index ffa03ce..44124f4 100644 --- a/src/mpfr.h +++ b/src/mpfr.h @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #define MPFR_VERSION_MAJOR 3 #define MPFR_VERSION_MINOR 1 #define MPFR_VERSION_PATCHLEVEL 2 -#define MPFR_VERSION_STRING "3.1.2-p1" +#define MPFR_VERSION_STRING "3.1.2-p2" /* Macros dealing with MPFR VERSION */ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c)) diff --git a/src/version.c b/src/version.c index c56626d..6b067fe 100644 --- a/src/version.c +++ b/src/version.c @@ -25,5 +25,5 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., const char * mpfr_get_version (void) { - return "3.1.2-p1"; + return "3.1.2-p2"; } diff --git a/tests/tfits.c b/tests/tfits.c index 8aebb41..57ddf09 100644 --- a/tests/tfits.c +++ b/tests/tfits.c @@ -33,155 +33,176 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #include "mpfr-intmax.h" #include "mpfr-test.h" -#define ERROR1 { printf("Initial error for x="); mpfr_dump(x); exit(1); } -#define ERROR2 { printf("Error for x="); mpfr_dump(x); exit(1); } +#define ERROR1(N) \ + do \ + { \ + printf("Error %d for rnd = %s and x = ", N, \ + mpfr_print_rnd_mode ((mpfr_rnd_t) r)); \ + mpfr_dump(x); \ + exit(1); \ + } \ + while (0) static void check_intmax (void); int main (void) { - mpfr_t x; + mpfr_t x, y; + int i, r; tests_start_mpfr (); mpfr_init2 (x, 256); - - /* Check NAN */ - mpfr_set_nan (x); - if (mpfr_fits_ulong_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_slong_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_uint_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_sint_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_ushort_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_sshort_p (x, MPFR_RNDN)) - ERROR1; - - /* Check INF */ - mpfr_set_inf (x, 1); - if (mpfr_fits_ulong_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_slong_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_uint_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_sint_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_ushort_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_sshort_p (x, MPFR_RNDN)) - ERROR1; - - /* Check Zero */ - MPFR_SET_ZERO (x); - if (!mpfr_fits_ulong_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_slong_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_uint_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_sint_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_ushort_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_sshort_p (x, MPFR_RNDN)) - ERROR2; - - /* Check small op */ - mpfr_set_str1 (x, "1@-1"); - if (!mpfr_fits_ulong_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_slong_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_uint_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_sint_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_ushort_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_sshort_p (x, MPFR_RNDN)) - ERROR2; - - /* Check 17 */ - mpfr_set_ui (x, 17, MPFR_RNDN); - if (!mpfr_fits_ulong_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_slong_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_uint_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_sint_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_ushort_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_sshort_p (x, MPFR_RNDN)) - ERROR2; - - /* Check all other values */ - mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN); - mpfr_mul_2exp (x, x, 1, MPFR_RNDN); - if (mpfr_fits_ulong_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_slong_p (x, MPFR_RNDN)) - ERROR1; - mpfr_mul_2exp (x, x, 40, MPFR_RNDN); - if (mpfr_fits_ulong_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_uint_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_sint_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_ushort_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_sshort_p (x, MPFR_RNDN)) - ERROR1; - - mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN); - if (!mpfr_fits_ulong_p (x, MPFR_RNDN)) - ERROR2; - mpfr_set_ui (x, LONG_MAX, MPFR_RNDN); - if (!mpfr_fits_slong_p (x, MPFR_RNDN)) - ERROR2; - mpfr_set_ui (x, UINT_MAX, MPFR_RNDN); - if (!mpfr_fits_uint_p (x, MPFR_RNDN)) - ERROR2; - mpfr_set_ui (x, INT_MAX, MPFR_RNDN); - if (!mpfr_fits_sint_p (x, MPFR_RNDN)) - ERROR2; - mpfr_set_ui (x, USHRT_MAX, MPFR_RNDN); - if (!mpfr_fits_ushort_p (x, MPFR_RNDN)) - ERROR2; - mpfr_set_ui (x, SHRT_MAX, MPFR_RNDN); - if (!mpfr_fits_sshort_p (x, MPFR_RNDN)) - ERROR2; - - mpfr_set_si (x, 1, MPFR_RNDN); - if (!mpfr_fits_sint_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_sshort_p (x, MPFR_RNDN)) - ERROR2; - - /* Check negative value */ - mpfr_set_si (x, -1, MPFR_RNDN); - if (!mpfr_fits_sint_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_sshort_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_slong_p (x, MPFR_RNDN)) - ERROR2; - if (mpfr_fits_uint_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_ushort_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_ulong_p (x, MPFR_RNDN)) - ERROR1; + mpfr_init2 (y, 8); + + RND_LOOP (r) + { + + /* Check NAN */ + mpfr_set_nan (x); + if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r)) + ERROR1 (1); + if (mpfr_fits_slong_p (x, (mpfr_rnd_t) r)) + ERROR1 (2); + if (mpfr_fits_uint_p (x, (mpfr_rnd_t) r)) + ERROR1 (3); + if (mpfr_fits_sint_p (x, (mpfr_rnd_t) r)) + ERROR1 (4); + if (mpfr_fits_ushort_p (x, (mpfr_rnd_t) r)) + ERROR1 (5); + if (mpfr_fits_sshort_p (x, (mpfr_rnd_t) r)) + ERROR1 (6); + + /* Check INF */ + mpfr_set_inf (x, 1); + if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r)) + ERROR1 (7); + if (mpfr_fits_slong_p (x, (mpfr_rnd_t) r)) + ERROR1 (8); + if (mpfr_fits_uint_p (x, (mpfr_rnd_t) r)) + ERROR1 (9); + if (mpfr_fits_sint_p (x, (mpfr_rnd_t) r)) + ERROR1 (10); + if (mpfr_fits_ushort_p (x, (mpfr_rnd_t) r)) + ERROR1 (11); + if (mpfr_fits_sshort_p (x, (mpfr_rnd_t) r)) + ERROR1 (12); + + /* Check Zero */ + MPFR_SET_ZERO (x); + if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r)) + ERROR1 (13); + if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r)) + ERROR1 (14); + if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r)) + ERROR1 (15); + if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r)) + ERROR1 (16); + if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r)) + ERROR1 (17); + if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r)) + ERROR1 (18); + + /* Check small positive op */ + mpfr_set_str1 (x, "1@-1"); + if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r)) + ERROR1 (19); + if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r)) + ERROR1 (20); + if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r)) + ERROR1 (21); + if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r)) + ERROR1 (22); + if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r)) + ERROR1 (23); + if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r)) + ERROR1 (24); + + /* Check 17 */ + mpfr_set_ui (x, 17, MPFR_RNDN); + if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r)) + ERROR1 (25); + if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r)) + ERROR1 (26); + if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r)) + ERROR1 (27); + if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r)) + ERROR1 (28); + if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r)) + ERROR1 (29); + if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r)) + ERROR1 (30); + + /* Check all other values */ + mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN); + mpfr_mul_2exp (x, x, 1, MPFR_RNDN); + if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r)) + ERROR1 (31); + if (mpfr_fits_slong_p (x, (mpfr_rnd_t) r)) + ERROR1 (32); + mpfr_mul_2exp (x, x, 40, MPFR_RNDN); + if (mpfr_fits_ulong_p (x, (mpfr_rnd_t) r)) + ERROR1 (33); + if (mpfr_fits_uint_p (x, (mpfr_rnd_t) r)) + ERROR1 (34); + if (mpfr_fits_sint_p (x, (mpfr_rnd_t) r)) + ERROR1 (35); + if (mpfr_fits_ushort_p (x, (mpfr_rnd_t) r)) + ERROR1 (36); + if (mpfr_fits_sshort_p (x, (mpfr_rnd_t) r)) + ERROR1 (37); + + mpfr_set_ui (x, ULONG_MAX, MPFR_RNDN); + if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r)) + ERROR1 (38); + mpfr_set_ui (x, LONG_MAX, MPFR_RNDN); + if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r)) + ERROR1 (39); + mpfr_set_ui (x, UINT_MAX, MPFR_RNDN); + if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r)) + ERROR1 (40); + mpfr_set_ui (x, INT_MAX, MPFR_RNDN); + if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r)) + ERROR1 (41); + mpfr_set_ui (x, USHRT_MAX, MPFR_RNDN); + if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r)) + ERROR1 (42); + mpfr_set_ui (x, SHRT_MAX, MPFR_RNDN); + if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r)) + ERROR1 (43); + + mpfr_set_si (x, 1, MPFR_RNDN); + if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r)) + ERROR1 (44); + if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r)) + ERROR1 (45); + + /* Check negative op */ + for (i = 1; i <= 4; i++) + { + int inv; + + mpfr_set_si_2exp (x, -i, -2, MPFR_RNDN); + mpfr_rint (y, x, (mpfr_rnd_t) r); + inv = MPFR_NOTZERO (y); + if (!mpfr_fits_ulong_p (x, (mpfr_rnd_t) r) ^ inv) + ERROR1 (46); + if (!mpfr_fits_slong_p (x, (mpfr_rnd_t) r)) + ERROR1 (47); + if (!mpfr_fits_uint_p (x, (mpfr_rnd_t) r) ^ inv) + ERROR1 (48); + if (!mpfr_fits_sint_p (x, (mpfr_rnd_t) r)) + ERROR1 (49); + if (!mpfr_fits_ushort_p (x, (mpfr_rnd_t) r) ^ inv) + ERROR1 (50); + if (!mpfr_fits_sshort_p (x, (mpfr_rnd_t) r)) + ERROR1 (51); + } + } mpfr_clear (x); + mpfr_clear (y); check_intmax (); @@ -189,85 +210,98 @@ main (void) return 0; } -static void check_intmax (void) +static void +check_intmax (void) { #ifdef _MPFR_H_HAVE_INTMAX_T - mpfr_t x; - - mpfr_init2 (x, sizeof (uintmax_t)*CHAR_BIT); - - /* Check NAN */ - mpfr_set_nan (x); - if (mpfr_fits_uintmax_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_intmax_p (x, MPFR_RNDN)) - ERROR1; - - /* Check INF */ - mpfr_set_inf (x, 1); - if (mpfr_fits_uintmax_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_intmax_p (x, MPFR_RNDN)) - ERROR1; - - /* Check Zero */ - MPFR_SET_ZERO (x); - if (!mpfr_fits_uintmax_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_intmax_p (x, MPFR_RNDN)) - ERROR2; - - /* Check small op */ - mpfr_set_str1 (x, "1@-1"); - if (!mpfr_fits_uintmax_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_intmax_p (x, MPFR_RNDN)) - ERROR2; - - /* Check 17 */ - mpfr_set_ui (x, 17, MPFR_RNDN); - if (!mpfr_fits_uintmax_p (x, MPFR_RNDN)) - ERROR2; - if (!mpfr_fits_intmax_p (x, MPFR_RNDN)) - ERROR2; - - /* Check hugest */ - mpfr_set_ui_2exp (x, 42, sizeof (uintmax_t) * 32, MPFR_RNDN); - if (mpfr_fits_uintmax_p (x, MPFR_RNDN)) - ERROR1; - if (mpfr_fits_intmax_p (x, MPFR_RNDN)) - ERROR1; - - /* Check all other values */ - mpfr_set_uj (x, MPFR_UINTMAX_MAX, MPFR_RNDN); - mpfr_add_ui (x, x, 1, MPFR_RNDN); - if (mpfr_fits_uintmax_p (x, MPFR_RNDN)) - ERROR1; - mpfr_set_uj (x, MPFR_UINTMAX_MAX, MPFR_RNDN); - if (!mpfr_fits_uintmax_p (x, MPFR_RNDN)) - ERROR2; - mpfr_set_sj (x, MPFR_INTMAX_MAX, MPFR_RNDN); - mpfr_add_ui (x, x, 1, MPFR_RNDN); - if (mpfr_fits_intmax_p (x, MPFR_RNDN)) - ERROR1; - mpfr_set_sj (x, MPFR_INTMAX_MAX, MPFR_RNDN); - if (!mpfr_fits_intmax_p (x, MPFR_RNDN)) - ERROR2; - mpfr_set_sj (x, MPFR_INTMAX_MIN, MPFR_RNDN); - if (!mpfr_fits_intmax_p (x, MPFR_RNDN)) - ERROR2; - mpfr_sub_ui (x, x, 1, MPFR_RNDN); - if (mpfr_fits_intmax_p (x, MPFR_RNDN)) - ERROR1; - - /* Check negative value */ - mpfr_set_si (x, -1, MPFR_RNDN); - if (!mpfr_fits_intmax_p (x, MPFR_RNDN)) - ERROR2; - if (mpfr_fits_uintmax_p (x, MPFR_RNDN)) - ERROR1; + mpfr_t x, y; + int i, r; + + mpfr_init2 (x, sizeof (uintmax_t) * CHAR_BIT); + mpfr_init2 (y, 8); + + RND_LOOP (r) + { + /* Check NAN */ + mpfr_set_nan (x); + if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (52); + if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (53); + + /* Check INF */ + mpfr_set_inf (x, 1); + if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (54); + if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (55); + + /* Check Zero */ + MPFR_SET_ZERO (x); + if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (56); + if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (57); + + /* Check positive small op */ + mpfr_set_str1 (x, "1@-1"); + if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (58); + if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (59); + + /* Check 17 */ + mpfr_set_ui (x, 17, MPFR_RNDN); + if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (60); + if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (61); + + /* Check hugest */ + mpfr_set_ui_2exp (x, 42, sizeof (uintmax_t) * 32, MPFR_RNDN); + if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (62); + if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (63); + + /* Check all other values */ + mpfr_set_uj (x, MPFR_UINTMAX_MAX, MPFR_RNDN); + mpfr_add_ui (x, x, 1, MPFR_RNDN); + if (mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (64); + mpfr_set_uj (x, MPFR_UINTMAX_MAX, MPFR_RNDN); + if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (65); + mpfr_set_sj (x, MPFR_INTMAX_MAX, MPFR_RNDN); + mpfr_add_ui (x, x, 1, MPFR_RNDN); + if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (66); + mpfr_set_sj (x, MPFR_INTMAX_MAX, MPFR_RNDN); + if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (67); + mpfr_set_sj (x, MPFR_INTMAX_MIN, MPFR_RNDN); + if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (68); + mpfr_sub_ui (x, x, 1, MPFR_RNDN); + if (mpfr_fits_intmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (69); + + /* Check negative op */ + for (i = 1; i <= 4; i++) + { + int inv; + + mpfr_set_si_2exp (x, -i, -2, MPFR_RNDN); + mpfr_rint (y, x, (mpfr_rnd_t) r); + inv = MPFR_NOTZERO (y); + if (!mpfr_fits_uintmax_p (x, (mpfr_rnd_t) r) ^ inv) + ERROR1 (70); + if (!mpfr_fits_intmax_p (x, (mpfr_rnd_t) r)) + ERROR1 (71); + } + } mpfr_clear (x); + mpfr_clear (y); #endif } - debian/patches/0003-Apply-upstream-s-patch-clang-divby0.patch0000644000000000000000000001116612231135546020762 0ustar From: Laurent Fousse Date: Sun, 20 Oct 2013 21:44:49 -0700 Subject: Apply upstream's patch "clang-divby0". --- PATCHES | 1 + VERSION | 2 +- src/mpfr-impl.h | 14 ++++++++++++-- src/mpfr.h | 2 +- src/version.c | 2 +- tests/tget_flt.c | 15 ++++++++++++--- tests/tset_ld.c | 7 +++++-- 7 files changed, 33 insertions(+), 10 deletions(-) diff --git a/PATCHES b/PATCHES index 7f9bcc2..484f42b 100644 --- a/PATCHES +++ b/PATCHES @@ -1,2 +1,3 @@ exp_2 fits-smallneg +clang-divby0 diff --git a/VERSION b/VERSION index cde8847..f29b65b 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -3.1.2-p2 +3.1.2-p3 diff --git a/src/mpfr-impl.h b/src/mpfr-impl.h index fa693d3..9a2fcca 100644 --- a/src/mpfr-impl.h +++ b/src/mpfr-impl.h @@ -468,8 +468,16 @@ __MPFR_DECLSPEC extern const mpfr_t __gmpfr_four; #define MPFR_LIMBS_PER_FLT ((IEEE_FLT_MANT_DIG-1)/GMP_NUMB_BITS+1) /* Visual C++ doesn't support +1.0/0.0, -1.0/0.0 and 0.0/0.0 - at compile time. */ -#if defined(_MSC_VER) && defined(_WIN32) && (_MSC_VER >= 1200) + at compile time. + Clang with -fsanitize=undefined is a bit similar due to a bug: + http://llvm.org/bugs/show_bug.cgi?id=17381 + but even without its sanitizer, it may be better to use the + double_zero version until IEEE 754 division by zero is properly + supported: + http://llvm.org/bugs/show_bug.cgi?id=17000 +*/ +#if (defined(_MSC_VER) && defined(_WIN32) && (_MSC_VER >= 1200)) || \ + defined(__clang__) static double double_zero = 0.0; # define DBL_NAN (double_zero/double_zero) # define DBL_POS_INF ((double) 1.0/double_zero) @@ -501,6 +509,8 @@ static double double_zero = 0.0; (with Xcode 2.4.1, i.e. the latest one). */ #define LVALUE(x) (&(x) == &(x) || &(x) != &(x)) #define DOUBLE_ISINF(x) (LVALUE(x) && ((x) > DBL_MAX || (x) < -DBL_MAX)) +/* The DOUBLE_ISNAN(x) macro is also valid on long double x + (assuming that the compiler isn't too broken). */ #ifdef MPFR_NANISNAN /* Avoid MIPSpro / IRIX64 / gcc -ffast-math (incorrect) optimizations. The + must not be replaced by a ||. With gcc -ffast-math, NaN is diff --git a/src/mpfr.h b/src/mpfr.h index 44124f4..45239f5 100644 --- a/src/mpfr.h +++ b/src/mpfr.h @@ -27,7 +27,7 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., #define MPFR_VERSION_MAJOR 3 #define MPFR_VERSION_MINOR 1 #define MPFR_VERSION_PATCHLEVEL 2 -#define MPFR_VERSION_STRING "3.1.2-p2" +#define MPFR_VERSION_STRING "3.1.2-p3" /* Macros dealing with MPFR VERSION */ #define MPFR_VERSION_NUM(a,b,c) (((a) << 16L) | ((b) << 8) | (c)) diff --git a/src/version.c b/src/version.c index 6b067fe..11d642b 100644 --- a/src/version.c +++ b/src/version.c @@ -25,5 +25,5 @@ http://www.gnu.org/licenses/ or write to the Free Software Foundation, Inc., const char * mpfr_get_version (void) { - return "3.1.2-p2"; + return "3.1.2-p3"; } diff --git a/tests/tget_flt.c b/tests/tget_flt.c index cf5bd5a..880f1a7 100644 --- a/tests/tget_flt.c +++ b/tests/tget_flt.c @@ -28,9 +28,17 @@ int main (void) { mpfr_t x, y; - float f, g, infp; + float f, g; int i; +#if !defined(MPFR_ERRDIVZERO) + float infp; +#endif + tests_start_mpfr (); + +#if !defined(MPFR_ERRDIVZERO) + /* The definition of DBL_POS_INF involves a division by 0. This makes + "clang -O2 -fsanitize=undefined -fno-sanitize-recover" fail. */ infp = (float) DBL_POS_INF; if (infp * 0.5 != infp) { @@ -38,8 +46,7 @@ main (void) fprintf (stderr, "(this is probably a compiler bug, please report)\n"); exit (1); } - - tests_start_mpfr (); +#endif mpfr_init2 (x, 24); mpfr_init2 (y, 24); @@ -353,6 +360,7 @@ main (void) printf ("expected %.8e, got %.8e\n", g, f); exit (1); } +#if !defined(MPFR_ERRDIVZERO) f = mpfr_get_flt (x, MPFR_RNDN); /* first round to 2^128 (even rule), thus we should get +Inf */ g = infp; @@ -376,6 +384,7 @@ main (void) printf ("expected %.8e, got %.8e\n", g, f); exit (1); } +#endif mpfr_clear (x); mpfr_clear (y); diff --git a/tests/tset_ld.c b/tests/tset_ld.c index 1e025aa..e1d3797 100644 --- a/tests/tset_ld.c +++ b/tests/tset_ld.c @@ -47,8 +47,11 @@ check_gcc33_bug (void) static int Isnan_ld (long double d) { - double e = (double) d; - if (DOUBLE_ISNAN (e)) + /* Do not convert d to double as this can give an overflow, which + may confuse compilers without IEEE 754 support (such as clang + -fsanitize=undefined), or trigger a trap if enabled. + The DOUBLE_ISNAN macro should work fine on long double. */ + if (DOUBLE_ISNAN (d)) return 1; LONGDOUBLE_NAN_ACTION (d, goto yes); return 0; debian/patches/series0000644000000000000000000000020712231135471012030 0ustar 0001-Apply-upstream-s-patch-exp_2.patch 0002-Apply-upstream-s-patch-fits-smallneg.patch 0003-Apply-upstream-s-patch-clang-divby0.patch debian/libmpfr-doc.install0000644000000000000000000000014112231134444012746 0ustar usr/share/info/mpfr.info usr/share/info usr/share/doc/mpfr/examples usr/share/doc/libmpfr-doc debian/cleanup_script.sh0000644000000000000000000000017612231134444012537 0ustar #!/bin/sh rm -f mpfr.texi fdl.texi grep -v texi Makefile.am > Makefile.am.free && mv Makefile.am.free Makefile.am autoreconf debian/libmpfr4.install0000644000000000000000000000002712231134444012272 0ustar usr/lib/*/libmpfr.so.* debian/libmpfr-doc.docs0000644000000000000000000000005012231134444012227 0ustar build/doc/mpfr.pdf build/doc/mpfr.html/ debian/source/0000755000000000000000000000000012231134444010464 5ustar debian/source/format0000644000000000000000000000001412231134444011672 0ustar 3.0 (quilt)