nan.h
Go to the documentation of this file.
1 
6 #ifndef SYMENGINE_NAN_H
7 #define SYMENGINE_NAN_H
8 
9 #include <symengine/basic.h>
10 #include <symengine/number.h>
11 
12 namespace SymEngine
13 {
14 
19 class NaN : public Number
20 {
21 public:
22  IMPLEMENT_TYPEID(SYMENGINE_NOT_A_NUMBER)
24  NaN();
25 
27  hash_t __hash__() const override;
28 
33  bool __eq__(const Basic &o) const override;
34  int compare(const Basic &o) const override;
35 
37  inline bool is_zero() const override
38  {
39  return false;
40  }
42  inline bool is_one() const override
43  {
44  return false;
45  }
47  inline bool is_minus_one() const override
48  {
49  return false;
50  }
51 
52  inline bool is_positive() const override
53  {
54  return false;
55  }
56 
57  inline bool is_negative() const override
58  {
59  return false;
60  }
61 
62  inline bool is_complex() const override
63  {
64  return false;
65  }
67  RCP<const Basic> conjugate() const override;
68  inline bool is_exact() const override
69  {
70  return false;
71  }
72  Evaluate &get_eval() const override;
73 
74  RCP<const Number> add(const Number &other) const override;
75  RCP<const Number> mul(const Number &other) const override;
76  RCP<const Number> div(const Number &other) const override;
77  RCP<const Number> pow(const Number &other) const override;
78  RCP<const Number> rpow(const Number &other) const override;
79 };
80 
81 } // namespace SymEngine
82 #endif
The base class for SymEngine.
#define IMPLEMENT_TYPEID(SYMENGINE_ID)
Inline members and functions.
Definition: basic.h:340
The lowest unit of symbolic representation.
Definition: basic.h:97
A class that will evaluate functions numerically.
Definition: number.h:200
bool is_positive() const override
Definition: nan.h:52
RCP< const Number > mul(const Number &other) const override
Multiplication.
Definition: nan.cpp:39
int compare(const Basic &o) const override
Definition: nan.cpp:23
Evaluate & get_eval() const override
Get Evaluate singleton to evaluate numerically.
Definition: nan.cpp:228
RCP< const Number > pow(const Number &other) const override
Power.
Definition: nan.cpp:49
bool is_minus_one() const override
Definition: nan.h:47
bool __eq__(const Basic &o) const override
Definition: nan.cpp:15
bool is_exact() const override
return true if the number is an exact representation
Definition: nan.h:68
RCP< const Number > add(const Number &other) const override
Addition.
Definition: nan.cpp:34
NaN()
Constructs NaN.
Definition: nan.cpp:7
bool is_zero() const override
Definition: nan.h:37
bool is_one() const override
Definition: nan.h:42
hash_t __hash__() const override
Definition: nan.cpp:9
RCP< const Number > div(const Number &other) const override
Division.
Definition: nan.cpp:44
RCP< const Basic > conjugate() const override
Definition: nan.cpp:29
bool is_complex() const override
Definition: nan.h:62
bool is_negative() const override
Definition: nan.h:57
Main namespace for SymEngine package.
Definition: add.cpp:19