#include <ostream>
#include <string>
#include "rational.hpp"
Go to the source code of this file.
Classes | |
class | number |
Functions | |
bool | operator== (number a, number b) |
bool | operator!= (number a, number b) |
bool | operator< (number a, number b) |
bool | operator<= (number a, number b) |
bool | operator> (number a, number b) |
bool | operator>= (number a, number b) |
number | operator- (number n) |
std::ostream & | operator<< (std::ostream &stream, number n) |
Compare two number objects for numeric inequality. The objects are coerced to a common type before comparing.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 149 of file number.hpp.
Negate a number.
n | the number |
n
Definition at line 202 of file number.hpp.
00203 { 00204 return number(0) - n; 00205 }
Compare two number objects for numeric less-than. The objects are coerced to a common type before comparing.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 160 of file number.hpp.
References number::less().
00161 { 00162 return a.less(b); 00163 }
std::ostream& operator<< | ( | std::ostream & | stream, | |
number | n | |||
) | [inline] |
Print a number
stream | The output stream | |
n | The number to print |
Definition at line 211 of file number.hpp.
References number::print().
00212 { 00213 n.print(stream); 00214 return stream; 00215 }
Compare two number objects for numeric less-than-or-equal. The objects are coerced to a common type before comparing.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 171 of file number.hpp.
Compare two number objects for numeric equality. The objects are coerced to a common type before comparing.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 138 of file number.hpp.
References number::equals().
00139 { 00140 return a.equals(b); 00141 }
Compare two number objects for numeric greater-than. The objects are coerced to a common type before comparing.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 182 of file number.hpp.
Compare two number objects for numeric greater-than-or-equal. The objects are coerced to a common type before comparing.
a | The left-hand operand | |
b | The right-hand operand |
Definition at line 193 of file number.hpp.