|
Claw
1.7.3
|
Custom precision real numbers. More...
#include <real_number.hpp>
Public Types | |
| typedef T | value_type |
| typedef real_number< T > | self_type |
Public Member Functions | |
| real_number () | |
| Constructuor. | |
| real_number (const value_type &v) | |
| Constructor. | |
| real_number (const self_type &that) | |
| Copy constructor. | |
| self_type | abs () const |
| Get the absolute value of the number. | |
| bool | operator< (const self_type &that) const |
| Tell if this number is stricty lower than an other number. | |
| bool | operator<= (const self_type &that) const |
| Tell if this number is lower or equal to an other number. | |
| bool | operator> (const self_type &that) const |
| Tell if this number is stricty greater than an other number. | |
| bool | operator>= (const self_type &that) const |
| Tell if this number is greater or equal to an other number. | |
| bool | operator== (const self_type &that) const |
| Tell if this number is equal to an other number. | |
| bool | operator!= (const self_type &that) const |
| Tell if this number is not equal to an other number. | |
| self_type | operator+ (const self_type &that) const |
| Sum two numbers. | |
| self_type | operator- (const self_type &that) const |
| Get the difference of two numbers. | |
| self_type | operator* (const self_type &that) const |
| Multiply two numbers. | |
| self_type | operator/ (const self_type &that) const |
| Divide by an other number. | |
| self_type & | operator+= (const self_type &that) |
| Add an other number. | |
| self_type & | operator-= (const self_type &that) |
| Subtract an other number. | |
| self_type & | operator*= (const self_type &that) |
| Multiply by an other number. | |
| self_type & | operator/= (const self_type &that) |
| Divide by an other number. | |
| std::ostream & | output (std::ostream &os) const |
| Output the value in a stream. | |
| template<typename U > | |
| operator U () const | |
| Cast the value. | |
Friends | |
| std::istream & | operator>> (std::istream &is, real_number< T > &self) |
| Read a number from a stream. | |
Custom precision real numbers.
Definition at line 67 of file real_number.hpp.
| claw::real_number< T >::real_number | ( | const value_type & | v | ) |
| claw::real_number< T >::real_number | ( | const self_type & | that | ) |
Copy constructor.
| that | The instance to copy from. |
Definition at line 61 of file real_number.tpp.
| bool claw::real_number< T >::operator!= | ( | const self_type & | that | ) | const |
Tell if this number is not equal to an other number.
| that | The other number. |
Definition at line 155 of file real_number.tpp.
| claw::real_number< T >::self_type claw::real_number< T >::operator* | ( | const self_type & | that | ) | const |
Multiply two numbers.
| that | The other number. |
Definition at line 191 of file real_number.tpp.
| claw::real_number< T >::self_type & claw::real_number< T >::operator*= | ( | const self_type & | that | ) |
Multiply by an other number.
| that | The other number. |
Definition at line 243 of file real_number.tpp.
| claw::real_number< T >::self_type claw::real_number< T >::operator+ | ( | const self_type & | that | ) | const |
| claw::real_number< T >::self_type & claw::real_number< T >::operator+= | ( | const self_type & | that | ) |
Add an other number.
| that | The other number. |
Definition at line 215 of file real_number.tpp.
| claw::real_number< T >::self_type claw::real_number< T >::operator- | ( | const self_type & | that | ) | const |
Get the difference of two numbers.
| that | The other number. |
Definition at line 179 of file real_number.tpp.
| claw::real_number< T >::self_type & claw::real_number< T >::operator-= | ( | const self_type & | that | ) |
Subtract an other number.
| that | The other number. |
Definition at line 229 of file real_number.tpp.
| claw::real_number< T >::self_type claw::real_number< T >::operator/ | ( | const self_type & | that | ) | const |
Divide by an other number.
| that | The other number. |
Definition at line 203 of file real_number.tpp.
| claw::real_number< T >::self_type & claw::real_number< T >::operator/= | ( | const self_type & | that | ) |
Divide by an other number.
| that | The other number. |
Definition at line 257 of file real_number.tpp.
| bool claw::real_number< T >::operator< | ( | const self_type & | that | ) | const |
Tell if this number is stricty lower than an other number.
| that | The other number. |
Definition at line 83 of file real_number.tpp.
| bool claw::real_number< T >::operator<= | ( | const self_type & | that | ) | const |
Tell if this number is lower or equal to an other number.
| that | The other number. |
Definition at line 103 of file real_number.tpp.
| bool claw::real_number< T >::operator== | ( | const self_type & | that | ) | const |
Tell if this number is equal to an other number.
| that | The other number. |
Definition at line 136 of file real_number.tpp.
| bool claw::real_number< T >::operator> | ( | const self_type & | that | ) | const |
Tell if this number is stricty greater than an other number.
| that | The other number. |
Definition at line 114 of file real_number.tpp.
| bool claw::real_number< T >::operator>= | ( | const self_type & | that | ) | const |
Tell if this number is greater or equal to an other number.
| that | The other number. |
Definition at line 125 of file real_number.tpp.
| std::ostream & claw::real_number< T >::output | ( | std::ostream & | os | ) | const |
Output the value in a stream.
| os | The stream in which the value is written. |
Definition at line 270 of file real_number.tpp.
Referenced by operator<<().
|
friend |
Read a number from a stream.
| is | The stream from which the value is read. |
| self | The number. |
Definition at line 339 of file real_number.tpp.
1.8.1.2