summaryrefslogtreecommitdiff
path: root/src/number.h
diff options
context:
space:
mode:
authorMike Buland <mike@xagasoft.com>2013-04-15 23:45:48 -0600
committerMike Buland <mike@xagasoft.com>2013-04-15 23:45:48 -0600
commit44542adf023315d60a8ffc4863f2b161b3c1eb90 (patch)
tree3500c1d6cfa3e5670bde199e24125c4b8e0c33db /src/number.h
parentf34eb76357fdfc314d6451fd11a2e4d6fcfce434 (diff)
downloadclic-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 'src/number.h')
-rw-r--r--src/number.h11
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
25private: 30private:
31 Number add( const Number &rhs, bool bSub ) const;
32
33private:
26 int iOrd; 34 int iOrd;
35 bool bPositive;
27 PackedIntArray aInt; 36 PackedIntArray aInt;
28}; 37};
29 38