diff options
author | Mike Buland <mike@xagasoft.com> | 2013-04-15 23:45:48 -0600 |
---|---|---|
committer | Mike Buland <mike@xagasoft.com> | 2013-04-15 23:45:48 -0600 |
commit | 44542adf023315d60a8ffc4863f2b161b3c1eb90 (patch) | |
tree | 3500c1d6cfa3e5670bde199e24125c4b8e0c33db /src/number.h | |
parent | f34eb76357fdfc314d6451fd11a2e4d6fcfce434 (diff) | |
download | clic-44542adf023315d60a8ffc4863f2b161b3c1eb90.tar.gz clic-44542adf023315d60a8ffc4863f2b161b3c1eb90.tar.bz2 clic-44542adf023315d60a8ffc4863f2b161b3c1eb90.tar.xz clic-44542adf023315d60a8ffc4863f2b161b3c1eb90.zip |
Addition, subtraction, and multiplication work now
Division isn't working yet, there are too many options, I'll figure out
something eventually :-P
Diffstat (limited to '')
-rw-r--r-- | src/number.h | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/number.h b/src/number.h index 4ada829..1489623 100644 --- a/src/number.h +++ b/src/number.h | |||
@@ -11,19 +11,28 @@ public: | |||
11 | Number( const Bu::String &sData, int iOrd=0 ); | 11 | Number( const Bu::String &sData, int iOrd=0 ); |
12 | virtual ~Number(); | 12 | virtual ~Number(); |
13 | 13 | ||
14 | Number &operator=( const Bu::String &sNum ); | ||
14 | Number operator+( const Number &rhs ) const; | 15 | Number operator+( const Number &rhs ) const; |
16 | Number operator-( const Number &rhs ) const; | ||
17 | Number operator*( const Number &rhs ) const; | ||
18 | |||
19 | void set( const Bu::String &sNum ); | ||
15 | 20 | ||
16 | operator Bu::String() const | 21 | operator Bu::String() const |
17 | { | 22 | { |
18 | return aInt.toString(); | 23 | return aInt.toString(); |
19 | } | 24 | } |
20 | 25 | ||
21 | Bu::String toString() const { return aInt.toString(); } | 26 | Bu::String toString() const; |
22 | 27 | ||
23 | int digit( int iOrder ) const; | 28 | int digit( int iOrder ) const; |
24 | 29 | ||
25 | private: | 30 | private: |
31 | Number add( const Number &rhs, bool bSub ) const; | ||
32 | |||
33 | private: | ||
26 | int iOrd; | 34 | int iOrd; |
35 | bool bPositive; | ||
27 | PackedIntArray aInt; | 36 | PackedIntArray aInt; |
28 | }; | 37 | }; |
29 | 38 | ||