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 /src/amount.h | |
parent | 94004358705b8fbfbb3b18226804820b1dca565e (diff) | |
download | fork-ledger-f1257cbc3eaddc075dcb4f9ebff17e4ea416c4ed.tar.gz fork-ledger-f1257cbc3eaddc075dcb4f9ebff17e4ea416c4ed.tar.bz2 fork-ledger-f1257cbc3eaddc075dcb4f9ebff17e4ea416c4ed.zip |
Removed all dependency on gdtoa.
Diffstat (limited to 'src/amount.h')
-rw-r--r-- | src/amount.h | 24 |
1 files changed, 3 insertions, 21 deletions
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; /*@}*/ |