diff options
author | John Wiegley <johnw@newartisans.com> | 2009-01-30 16:19:31 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-01-30 16:19:31 -0400 |
commit | f1257cbc3eaddc075dcb4f9ebff17e4ea416c4ed (patch) | |
tree | ee13fa7f7e046735b8a267bef0a3525ccb343b12 | |
parent | 94004358705b8fbfbb3b18226804820b1dca565e (diff) | |
download | fork-ledger-f1257cbc3eaddc075dcb4f9ebff17e4ea416c4ed.tar.gz fork-ledger-f1257cbc3eaddc075dcb4f9ebff17e4ea416c4ed.tar.bz2 fork-ledger-f1257cbc3eaddc075dcb4f9ebff17e4ea416c4ed.zip |
Removed all dependency on gdtoa.
-rw-r--r-- | .gitmodules | 3 | ||||
-rw-r--r-- | Makefile.am | 47 | ||||
-rw-r--r-- | configure.ac | 14 | ||||
m--------- | lib/gdtoa | 0 | ||||
-rw-r--r-- | python/py_amount.cc | 38 | ||||
-rw-r--r-- | python/py_value.cc | 32 | ||||
-rw-r--r-- | src/amount.cc | 12 | ||||
-rw-r--r-- | src/amount.h | 24 | ||||
-rw-r--r-- | src/balance.h | 6 | ||||
-rw-r--r-- | src/balpair.h | 2 | ||||
-rw-r--r-- | src/system.hh | 3 | ||||
-rw-r--r-- | src/value.h | 9 | ||||
-rw-r--r-- | test/unit/t_amount.cc | 19 |
13 files changed, 8 insertions, 201 deletions
diff --git a/.gitmodules b/.gitmodules index 1352a8bb..a2d85507 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,6 +1,3 @@ -[submodule "lib/gdtoa"] - path = lib/gdtoa - url = git://github.com/jwiegley/gdtoa.git [submodule "lib/cppunit"] path = lib/cppunit url = git://github.com/jwiegley/cppunit.git diff --git a/Makefile.am b/Makefile.am index 2e0e0136..8417adb2 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,8 +1,4 @@ -VERSION = 3.0 - -if HAVE_GDTOA -SUBDIRS = lib/gdtoa -endif +VERSION = 3.0 EXTRA_DIST = autogen.sh contrib lib_LTLIBRARIES = \ @@ -17,9 +13,6 @@ lib_LTLIBRARIES = \ lib_cppflags = -I$(srcdir)/src -I$(srcdir)/lib \ -I$(srcdir)/lib/utfcpp/source \ -I$(srcdir)/lib/irrxml/src -if HAVE_GDTOA -lib_cppflags += -I$(top_builddir)/lib/gdtoa -I$(srcdir)/lib/gdtoa -endif if HAVE_LIBOFX lib_cppflags += -DHAVE_LIBOFX=1 endif @@ -209,9 +202,6 @@ ledger_CPPFLAGS += -DHAVE_BOOST_PYTHON=1 -I$(srcdir)/python endif ledger_SOURCES = src/main.cc ledger_LDADD = $(LIBOBJS) $(lib_LTLIBRARIES) -if HAVE_GDTOA -ledger_LDADD += lib/gdtoa/libgdtoa.la -endif if HAVE_BOOST_PYTHON ledger_LDADD += libledger_python.la endif @@ -269,22 +259,6 @@ clean-local: uninstall-hook: rm -f $(DESTDIR)$(libdir)/Ledger-$(VERSION)-py$(PYTHON_VERSION).egg-info -if HAVE_GDTOA -install-exec-hook: - BUILD_DIR=`cd $(top_builddir); pwd`; \ - SRC_DIR=`cd $(srcdir); pwd`; \ - (cd $(srcdir); \ - CFLAGS="$(CPPFLAGS) -I$(srcdir) -I$$BUILD_DIR -I$$BUILD_DIR/lib/gdtoa $(libledger_python_la_CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)" \ - LDFLAGS="$(LDFLAGS) -L$$BUILD_DIR -L$$BUILD_DIR/.libs -L$$BUILD_DIR/lib/gdtoa -L$$BUILD_DIR/lib/gdtoa/.libs" \ - ARCHFLAGS="$(ARCHFLAGS)" PYLIBS="$(PYLIBS)" VERSION="$(VERSION)" \ - SRCDIR="$$SRC_DIR" $(PYTHON) python/setup.py install \ - --skip-build \ - --root=$(DESTDIR)/ \ - --prefix=$(prefix) \ - --install-lib=$(libdir) \ - --install-headers=$(pkgincludedir) \ - --install-data=$(datadir)) -else install-exec-hook: BUILD_DIR=`cd $(top_builddir); pwd`; \ SRC_DIR=`cd $(srcdir); pwd`; \ @@ -299,7 +273,6 @@ install-exec-hook: --install-lib=$(libdir) \ --install-headers=$(pkgincludedir) \ --install-data=$(datadir)) -endif ledger_so_SOURCES = $(all_sources) ledger_so_DEPENDENCIES = $(lib_LTLIBRARIES) @@ -315,24 +288,10 @@ PYLIBS = ledger_util ledger_math ledger_expr \ boost_regex$(BOOST_SUFFIX) \ boost_python$(BOOST_SUFFIX) -if HAVE_GDTOA -PYLIBS += gdtoa -endif if HAVE_LIBOFX PYLIBS += ofx endif -if HAVE_GDTOA -ledger.so: $(ledger_so_SOURCES) $(ledger_so_DEPENDENCIES) - BUILD_DIR=`cd $(top_builddir); pwd`; \ - SRC_DIR=`cd $(srcdir); pwd`; \ - (cd $(srcdir); \ - CFLAGS="$(CPPFLAGS) -I$(srcdir) -I$$BUILD_DIR -I$$BUILD_DIR/lib/gdtoa $(libledger_python_la_CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)" \ - LDFLAGS="$(LDFLAGS) -L$$BUILD_DIR -L$$BUILD_DIR/.libs -L$$BUILD_DIR/lib/gdtoa -L$$BUILD_DIR/lib/gdtoa/.libs" \ - ARCHFLAGS="$(ARCHFLAGS)" PYLIBS="$(PYLIBS)" VERSION="$(VERSION)" \ - SRCDIR="$$SRC_DIR" $(PYTHON) python/setup.py build \ - --build-lib=$$BUILD_DIR/ --build-temp=$$BUILD_DIR/build -f) -else ledger.so: $(ledger_so_SOURCES) $(ledger_so_DEPENDENCIES) BUILD_DIR=`cd $(top_builddir); pwd`; \ SRC_DIR=`cd $(srcdir); pwd`; \ @@ -342,7 +301,6 @@ ledger.so: $(ledger_so_SOURCES) $(ledger_so_DEPENDENCIES) ARCHFLAGS="$(ARCHFLAGS)" PYLIBS="$(PYLIBS)" VERSION="$(VERSION)" \ SRCDIR="$$SRC_DIR" $(PYTHON) python/setup.py build \ --build-lib=$$BUILD_DIR/ --build-temp=$$BUILD_DIR/build -f) -endif endif @@ -396,9 +354,6 @@ math_tests_SOURCES = \ math_tests_CPPFLAGS = -I$(srcdir)/test $(lib_cppflags) math_tests_LDADD = $(util_tests_LDADD) libledger_math.la -if HAVE_GDTOA -math_tests_LDADD += lib/gdtoa/libgdtoa.la -endif expr_tests_SOURCES = \ test/UnitTests.cc \ diff --git a/configure.ac b/configure.ac index 46d2e13c..9cdb5efe 100644 --- a/configure.ac +++ b/configure.ac @@ -23,20 +23,6 @@ AM_PROG_LIBTOOL AM_PATH_LISPDIR # Check for options -AC_ARG_ENABLE(gdtoa, - [ --disable-gdtoa Do not build with David Gay's gdtoa library], - [case "${enableval}" in - yes) gdtoa=true ;; - no) gdtoa=false ;; - *) AC_MSG_ERROR(bad value ${enableval} for --enable-gdtoa) ;; - esac],[gdtoa=true]) - -if test x$gdtoa = xtrue; then - AM_CONDITIONAL(HAVE_GDTOA, true) - AC_DEFINE([HAVE_GDTOA], [1], [Whether gdtoa is available]) - AC_CONFIG_SUBDIRS([lib/gdtoa]) -fi - AC_ARG_ENABLE(debug, [ --enable-debug Turn on debugging], [case "${enableval}" in diff --git a/lib/gdtoa b/lib/gdtoa deleted file mode 160000 -Subproject 120ed618432939b2f372d3249230e8812c04ddc diff --git a/python/py_amount.cc b/python/py_amount.cc index 372b62f8..f5e45888 100644 --- a/python/py_amount.cc +++ b/python/py_amount.cc @@ -48,14 +48,12 @@ amount_t py_round_1(const amount_t& amount, amount_t::precision_t prec) { return amount.round(prec); } -#ifdef HAVE_GDTOA double py_to_double_0(amount_t& amount) { return amount.to_double(); } double py_to_double_1(amount_t& amount, bool no_check) { return amount.to_double(no_check); } -#endif long py_to_long_0(amount_t& amount) { return amount.to_long(); @@ -169,9 +167,7 @@ void export_amount() make_getter(&amount_t::stream_fullstrings), make_setter(&amount_t::stream_fullstrings)) -#ifdef HAVE_GDTOA .def(init<double>()) -#endif .def(init<long>()) .def(init<std::string>()) @@ -187,108 +183,80 @@ internal precision.") .def(self == self) .def(self == long()) .def(long() == self) -#ifdef HAVE_GDTOA .def(self == double()) .def(double() == self) -#endif .def(self != self) .def(self != long()) .def(long() != self) -#ifdef HAVE_GDTOA .def(self != double()) .def(double() != self) -#endif .def(! self) .def(self < self) .def(self < long()) .def(long() < self) -#ifdef HAVE_GDTOA .def(self < double()) .def(double() < self) -#endif .def(self <= self) .def(self <= long()) .def(long() <= self) -#ifdef HAVE_GDTOA .def(self <= double()) .def(double() <= self) -#endif .def(self > self) .def(self > long()) .def(long() > self) -#ifdef HAVE_GDTOA .def(self > double()) .def(double() > self) -#endif .def(self >= self) .def(self >= long()) .def(long() >= self) -#ifdef HAVE_GDTOA .def(self >= double()) .def(double() >= self) -#endif .def(self += self) .def(self += long()) -#ifdef HAVE_GDTOA .def(self += double()) -#endif .def(self + self) .def(self + long()) .def(long() + self) -#ifdef HAVE_GDTOA .def(self + double()) .def(double() + self) -#endif .def(self -= self) .def(self -= long()) -#ifdef HAVE_GDTOA .def(self -= double()) -#endif .def(self - self) .def(self - long()) .def(long() - self) -#ifdef HAVE_GDTOA .def(self - double()) .def(double() - self) -#endif .def(self *= self) .def(self *= long()) -#ifdef HAVE_GDTOA .def(self *= double()) -#endif .def(self * self) .def(self * long()) .def(long() * self) -#ifdef HAVE_GDTOA .def(self * double()) .def(double() * self) -#endif .def(self /= self) .def(self /= long()) -#ifdef HAVE_GDTOA .def(self /= double()) -#endif .def(self / self) .def(self / long()) .def(long() / self) -#ifdef HAVE_GDTOA .def(self / double()) .def(double() / self) -#endif .def("precision", &amount_t::precision) @@ -323,11 +291,9 @@ internal precision.") .def("is_realzero", &amount_t::is_realzero) .def("is_null", &amount_t::is_null) -#ifdef HAVE_GDTOA .def("to_double", py_to_double_0) .def("to_double", py_to_double_1) .def("__float__", py_to_double_0) -#endif .def("to_long", py_to_long_0) .def("to_long", py_to_long_1) .def("__int__", py_to_long_0) @@ -336,9 +302,7 @@ internal precision.") .def("to_fullstring", &amount_t::to_fullstring) .def("__repr__", &amount_t::to_fullstring) -#ifdef HAVE_GDTOA .def("fits_in_double", &amount_t::fits_in_double) -#endif .def("fits_in_long", &amount_t::fits_in_long) .def("quantity_string", &amount_t::quantity_string) @@ -391,9 +355,7 @@ internal precision.") register_optional_to_python<amount_t>(); -#ifdef HAVE_GDTOA implicitly_convertible<double, amount_t>(); -#endif implicitly_convertible<long, amount_t>(); implicitly_convertible<string, amount_t>(); diff --git a/python/py_value.cc b/python/py_value.cc index f1b36acd..4156ee44 100644 --- a/python/py_value.cc +++ b/python/py_value.cc @@ -89,9 +89,7 @@ void export_value() .staticmethod("shutdown") #endif -#ifdef HAVE_GDTOA .def(init<double>()) -#endif .def(init<long>()) .def(init<std::string>()) .def(init<date_t>()) @@ -111,108 +109,80 @@ void export_value() .def(self == self) .def(self == long()) .def(long() == self) -#ifdef HAVE_GDTOA .def(self == double()) .def(double() == self) -#endif .def(self != self) .def(self != long()) .def(long() != self) -#ifdef HAVE_GDTOA .def(self != double()) .def(double() != self) -#endif .def(! self) .def(self < self) .def(self < long()) .def(long() < self) -#ifdef HAVE_GDTOA .def(self < double()) .def(double() < self) -#endif .def(self <= self) .def(self <= long()) .def(long() <= self) -#ifdef HAVE_GDTOA .def(self <= double()) .def(double() <= self) -#endif .def(self > self) .def(self > long()) .def(long() > self) -#ifdef HAVE_GDTOA .def(self > double()) .def(double() > self) -#endif .def(self >= self) .def(self >= long()) .def(long() >= self) -#ifdef HAVE_GDTOA .def(self >= double()) .def(double() >= self) -#endif .def(self += self) .def(self += long()) -#ifdef HAVE_GDTOA .def(self += double()) -#endif .def(self + self) .def(self + long()) .def(long() + self) -#ifdef HAVE_GDTOA .def(self + double()) .def(double() + self) -#endif .def(self -= self) .def(self -= long()) -#ifdef HAVE_GDTOA .def(self -= double()) -#endif .def(self - self) .def(self - long()) .def(long() - self) -#ifdef HAVE_GDTOA .def(self - double()) .def(double() - self) -#endif .def(self *= self) .def(self *= long()) -#ifdef HAVE_GDTOA .def(self *= double()) -#endif .def(self * self) .def(self * long()) .def(long() * self) -#ifdef HAVE_GDTOA .def(self * double()) .def(double() * self) -#endif .def(self /= self) .def(self /= long()) -#ifdef HAVE_GDTOA .def(self /= double()) -#endif .def(self / self) .def(self / long()) .def(long() / self) -#ifdef HAVE_GDTOA .def(self / double()) .def(double() / self) -#endif .def("add", &value_t::add, return_value_policy<reference_existing_object>()) @@ -336,9 +306,7 @@ void export_value() register_optional_to_python<value_t>(); -#ifdef HAVE_GDTOA implicitly_convertible<double, value_t>(); -#endif implicitly_convertible<long, value_t>(); implicitly_convertible<string, value_t>(); implicitly_convertible<date_t, value_t>(); diff --git a/src/amount.cc b/src/amount.cc index d7a689cc..55a71521 100644 --- a/src/amount.cc +++ b/src/amount.cc @@ -223,8 +223,6 @@ void amount_t::_release() } -#ifdef HAVE_GDTOA - namespace { amount_t::precision_t convert_double(mpz_t dest, double val) { @@ -277,8 +275,6 @@ amount_t::amount_t(const double val) : commodity_(NULL) quantity->prec = convert_double(MPZ(quantity), val); } -#endif // HAVE_GDTOA - amount_t::amount_t(const unsigned long val) : commodity_(NULL) { TRACE_CTOR(amount_t, "const unsigned long"); @@ -683,8 +679,6 @@ bool amount_t::is_zero() const } -#ifdef HAVE_GDTOA - double amount_t::to_double(bool no_check) const { if (! quantity) @@ -716,8 +710,6 @@ double amount_t::to_double(bool no_check) const return value; } -#endif // HAVE_GDTOA - long amount_t::to_long(bool no_check) const { if (! quantity) @@ -735,16 +727,12 @@ long amount_t::to_long(bool no_check) const return value; } -#ifdef HAVE_GDTOA - bool amount_t::fits_in_double() const { double value = to_double(true); return *this == amount_t(value); } -#endif // HAVE_GDTOA - bool amount_t::fits_in_long() const { long value = to_long(true); diff --git a/src/amount.h b/src/amount.h index 8ea9c2af..2285591a 100644 --- a/src/amount.h +++ b/src/amount.h @@ -49,11 +49,6 @@ * division or multiplication is performed, the precision is * automatically expanded to include as many extra digits as necessary * to avoid losing information. - * - * Floating-point math is never used at any point in these routines. If - * floating-point numbers are used to create amounts, they are first - * rendered to decimal using David Gay's gdtoa library, and then parsed - * as multi-precision values. */ #ifndef _AMOUNT_H #define _AMOUNT_H @@ -80,14 +75,9 @@ DECLARE_EXCEPTION(amount_error, std::runtime_error); */ class amount_t : public ordered_field_operators<amount_t, -#ifdef HAVE_GDTOA ordered_field_operators<amount_t, double, -#endif ordered_field_operators<amount_t, unsigned long, - ordered_field_operators<amount_t, long> > > -#ifdef HAVE_GDTOA - > -#endif + ordered_field_operators<amount_t, long> > > > { public: /** Ready the amount subsystem for use. @@ -172,11 +162,9 @@ public: TRACE_CTOR(amount_t, ""); } -#ifdef HAVE_GDTOA /** Convert a double to an amount. As much precision as possible is decoded from the binary floating point number. */ amount_t(const double val); -#endif /** Convert an unsigned long to an amount. It's precision is zero. */ amount_t(const unsigned long val); @@ -251,11 +239,9 @@ public: be freed. */ amount_t& operator=(const amount_t& amt); -#ifdef HAVE_GDTOA amount_t& operator=(const double val) { return *this = amount_t(val); } -#endif amount_t& operator=(const unsigned long val) { return *this = amount_t(val); } @@ -506,18 +492,14 @@ public: been stripped and the full, internal precision of the amount would be displayed. */ -#ifdef HAVE_GDTOA double to_double(bool no_check = false) const; -#endif long to_long(bool no_check = false) const; string to_string() const; string to_fullstring() const; string quantity_string() const; -#ifdef HAVE_GDTOA - bool fits_in_double() const; -#endif - bool fits_in_long() const; + bool fits_in_double() const; + bool fits_in_long() const; /*@}*/ diff --git a/src/balance.h b/src/balance.h index 37641836..8f565e78 100644 --- a/src/balance.h +++ b/src/balance.h @@ -115,13 +115,11 @@ public: if (! amt.is_realzero()) amounts.insert(amounts_map::value_type(&amt.commodity(), amt)); } -#ifdef HAVE_GDTOA balance_t(const double val) { TRACE_CTOR(balance_t, "const double"); amounts.insert (amounts_map::value_type(amount_t::current_pool->null_commodity, val)); } -#endif balance_t(const unsigned long val) { TRACE_CTOR(balance_t, "const unsigned long"); amounts.insert @@ -236,11 +234,9 @@ public: virtual balance_t& operator*=(const amount_t& amt); -#ifdef HAVE_GDTOA balance_t& operator*=(const double val) { return *this *= amount_t(val); } -#endif balance_t& operator*=(const unsigned long val) { return *this *= amount_t(val); } @@ -250,11 +246,9 @@ public: virtual balance_t& operator/=(const amount_t& amt); -#ifdef HAVE_GDTOA balance_t& operator/=(const double val) { return *this /= amount_t(val); } -#endif balance_t& operator/=(const unsigned long val) { return *this /= amount_t(val); } diff --git a/src/balpair.h b/src/balpair.h index 3f83df96..90103c1e 100644 --- a/src/balpair.h +++ b/src/balpair.h @@ -113,11 +113,9 @@ public: : balance_t(amt), cost(cost_amt) { TRACE_CTOR(balance_pair_t, "const amount_t&, const amount_t&"); } -#ifdef HAVE_GDTOA balance_pair_t(const double val) : balance_t(val) { TRACE_CTOR(balance_pair_t, "const double"); } -#endif balance_pair_t(const unsigned long val) : balance_t(val) { TRACE_CTOR(balance_pair_t, "const unsigned long"); } diff --git a/src/system.hh b/src/system.hh index 1096271b..7978119f 100644 --- a/src/system.hh +++ b/src/system.hh @@ -121,9 +121,6 @@ typedef std::ostream::pos_type ostream_pos_type; #endif #include <gmp.h> -#ifdef HAVE_GDTOA -#include "gdtoa.h" -#endif #include "SHA1.h" #include "irrXML.h" // XML parser diff --git a/src/value.h b/src/value.h index dbb83283..393ca3d3 100644 --- a/src/value.h +++ b/src/value.h @@ -78,14 +78,9 @@ class value_t multiplicative<value_t, balance_pair_t, multiplicative<value_t, balance_t, ordered_field_operators<value_t, amount_t, -#ifdef HAVE_GDTOA ordered_field_operators<value_t, double, -#endif ordered_field_operators<value_t, unsigned long, - ordered_field_operators<value_t, long> > > > > > > > > > -#ifdef HAVE_GDTOA - > -#endif + ordered_field_operators<value_t, long> > > > > > > > > > > { public: /** @@ -288,12 +283,10 @@ public: TRACE_CTOR(value_t, "const unsigned long"); set_amount(val); } -#ifdef HAVE_GDTOA value_t(const double val) { TRACE_CTOR(value_t, "const double"); set_amount(val); } -#endif value_t(const amount_t& val) { TRACE_CTOR(value_t, "const amount_t&"); set_amount(val); diff --git a/test/unit/t_amount.cc b/test/unit/t_amount.cc index 69af0c24..6dc1a5b6 100644 --- a/test/unit/t_amount.cc +++ b/test/unit/t_amount.cc @@ -423,10 +423,8 @@ void AmountTestCase::testComparisons() assertTrue(100L > x1); assertTrue(x1 < 100UL); assertTrue(100UL > x1); -#ifdef HAVE_GDTOA assertTrue(x1 < 100.0); assertTrue(100.0 > x1); -#endif assertValid(x0); assertValid(x1); @@ -540,9 +538,7 @@ void AmountTestCase::testCommodityAddition() assertThrow(x1 + x4, amount_error); assertThrow(x1 + x5, amount_error); assertThrow(x1 + x6, amount_error); -#ifdef HAVE_GDTOA assertThrow(x1 + 123.45, amount_error); -#endif assertThrow(x1 + 123L, amount_error); assertEqual(amount_t("DM 246.90"), x3 + x3); @@ -656,9 +652,7 @@ void AmountTestCase::testCommoditySubtraction() assertThrow(x1 - x4, amount_error); assertThrow(x1 - x5, amount_error); assertThrow(x1 - x6, amount_error); -#ifdef HAVE_GDTOA assertThrow(x1 - 123.45, amount_error); -#endif assertThrow(x1 - 123L, amount_error); assertEqual(amount_t("DM 0.00"), x3 - x3); @@ -871,6 +865,9 @@ void AmountTestCase::testIntegerDivision() assertEqual(amount_t(1L), x4 / x4); assertEqual(amount_t("2204585520061728377204585.517857"), x4 / y4); + assertEqual(amount_t("0.000000000000000000000000000001"), + amount_t("10") / amount_t("10000000000000000000000000000000")); + assertValid(x1); assertValid(y1); assertValid(x4); @@ -1386,14 +1383,10 @@ void AmountTestCase::testIntegerConversion() amount_t x2("12345682348723487324"); assertThrow(x0.to_long(), amount_error); -#ifdef HAVE_GDTOA assertThrow(x0.to_double(), amount_error); -#endif assertFalse(x2.fits_in_long()); assertEqual(123456L, x1.to_long()); -#ifdef HAVE_GDTOA assertEqual(123456.0, x1.to_double()); -#endif assertEqual(string("123456"), x1.to_string()); assertEqual(string("123456"), x1.quantity_string()); @@ -1406,14 +1399,10 @@ void AmountTestCase::testFractionalConversion() amount_t x2("1234.5683787634678348734"); assertThrow(x1.to_long(), amount_error); // loses precision -#ifdef HAVE_GDTOA assertThrow(x2.to_double(), amount_error); // loses precision assertFalse(x2.fits_in_double()); -#endif assertEqual(1234L, x1.to_long(true)); -#ifdef HAVE_GDTOA assertEqual(1234.56, x1.to_double()); -#endif assertEqual(string("1234.56"), x1.to_string()); assertEqual(string("1234.56"), x1.quantity_string()); @@ -1426,9 +1415,7 @@ void AmountTestCase::testCommodityConversion() assertThrow(x1.to_long(), amount_error); // loses precision assertEqual(1234L, x1.to_long(true)); -#ifdef HAVE_GDTOA assertEqual(1234.56, x1.to_double()); -#endif assertEqual(string("$1234.56"), x1.to_string()); assertEqual(string("1234.56"), x1.quantity_string()); |