summaryrefslogtreecommitdiff
path: root/number.h
blob: c508a814700b8df499e196ab6a545a45c2dab557 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#pragma once

#include <list>

#include <cstdint>

class number {
public:
    number() = default;

    /**
     * \brief Tells whether the number passed as parameter is strictly less
     * than this number.
     *
     * \param n The number to compare with this number.
     */
    bool operator<(const number &n) const;

    /**
     * \brief Tells whether the number passed as parameter is strictly greater
     * than this number.
     *
     * \param n The number to compare with this number.
     */
    bool operator>(const number &n) const;

    /**
     * \brief Tells whether the number passed as parameter is less than or
     * equal to this number.
     *
     * \param n The number to compare with this number.
     */
    bool operator<=(const number &n) const;

    /**
     * \brief Tells whether the number passed as parameter is greater than or
     * equal to this number.
     *
     * \param n The number to compare with this number.
     */
    bool operator>=(const number &n) const;

    /**
     * \brief Tells whether the number passed as parameter is equal to this
     * number.
     *
     * \param n The number to compare with this number.
     */
    bool operator==(const number &n) const;

    /**
     * \brief Tells whether the number passed as parameter is not equal to this
     * number.
     *
     * \param n The number to compare with this number.
     */
    bool operator!=(const number &n) const;

private:
     /* First item is the least significant. */
    std::list<std::uint64_t> _operands;
};