summaryrefslogtreecommitdiff
path: root/number.h
AgeCommit message (Collapse)Author
2017-11-19Consistently document the methodsOlivier Gayot
Signed-off-by: Olivier Gayot <og@satcom1.com>
2017-11-19Added bool operator and ! operatorOlivier Gayot
We can now check if a number evaluates to false or true by doing a conversion to bool or use the ! operator. Signed-off-by: Olivier Gayot <og@satcom1.com>
2017-11-19Allowed construction of number from 64-bits-wide integerOlivier Gayot
Signed-off-by: Olivier Gayot <og@satcom1.com>
2017-11-19Added the left-shift computationOlivier Gayot
Signed-off-by: Olivier Gayot <og@satcom1.com>
2017-11-19Allow conversion of number to 32 bits integerOlivier Gayot
The method to_uint32() converts a number to a 32-bits-wide integer. The function throws if number cannot be represented using only a single 32-bits-wide integer. Signed-off-by: Olivier Gayot <og@satcom1.com>
2017-11-19Added multiplication of two numbersOlivier Gayot
We are using an easy to implemented but extremely slow algorithm to compute the multiplication of two numbers of size n. Signed-off-by: Olivier Gayot <og@satcom1.com>
2017-11-19Added pre-increment operator and += operatorOlivier Gayot
Signed-off-by: Olivier Gayot <og@satcom1.com>
2017-11-19Added constructors to copy and create a number from an integerOlivier Gayot
Signed-off-by: Olivier Gayot <og@satcom1.com>
2017-11-19Made use of 32bits integer instead of 64bitsOlivier Gayot
This will allow multiplication to hold the result of the multiplication of two 32 bits integer in a 64 bits integer. Signed-off-by: Olivier Gayot <og@satcom1.com>
2017-11-19Allow a number to be used in an ostream objectOlivier Gayot
When a number is streamed into a ostream object, the hexadecimal representation of the number is given to the stream. Signed-off-by: Olivier Gayot <og@satcom1.com>
2017-11-19Added functions to print a number as hex or dec stringOlivier Gayot
Signed-off-by: Olivier Gayot <og@satcom1.com>
2017-11-19Added the addition of two numbersOlivier Gayot
We're using the grade school addition method to compute the sum of two numbers of size n. Signed-off-by: Olivier Gayot <og@satcom1.com>
2017-11-19Added a class "number" with comparison operatorsOlivier Gayot
Signed-off-by: Olivier Gayot <og@satcom1.com>