Skip to content

Commit

Permalink
less than double
Browse files Browse the repository at this point in the history
  • Loading branch information
ohhmm committed Sep 21, 2024
1 parent be4e793 commit 8fc91b8
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 9 additions & 0 deletions omnn/math/Valuable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1768,6 +1768,15 @@ bool Valuable::SerializedStrEqual(const std::string_view& s) const {
}
}

bool Valuable::operator<(double value) const {
if (exp) {
return exp->operator<(value);
} else {
return operator<(Fraction(value));
}
}


bool Valuable::operator==(const Valuable& v) const
{
if(exp)
Expand Down
5 changes: 3 additions & 2 deletions omnn/math/Valuable.h
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,7 @@ class Valuable
const Variable& C = constants::integration_result_constant) const;

virtual bool operator<(const Valuable&) const;
virtual bool operator<(double) const;
virtual bool operator==(const Valuable&) const;
virtual void optimize(); /// if it simplifies than it should become the type
View GetView() const;
Expand Down Expand Up @@ -393,8 +394,8 @@ class Valuable
virtual Valuable Sin() const;
virtual Valuable Sqrt() const;
virtual Valuable& sqrt();
virtual Valuable Tg() const;
virtual Valuable Tanh() const;
virtual Valuable Tg() const;
virtual Valuable Tanh() const;
virtual void gamma(); // https://en.wikipedia.org/wiki/Gamma_function
virtual Valuable Gamma() const;
virtual Valuable& factorial();
Expand Down

0 comments on commit 8fc91b8

Please sign in to comment.