Skip to content

Commit

Permalink
De-bug common Valuable::reciprocal
Browse files Browse the repository at this point in the history
  • Loading branch information
ohhmm committed Sep 29, 2024
1 parent 3e67d1c commit f55c750
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions omnn/math/Product.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -895,8 +895,8 @@ namespace math {
}
else if (v.IsExponentiation())
{
auto& e = v.as<Exponentiation>();
auto& vExpBase = e.getBase();
auto& exponentiation = v.as<Exponentiation>();
auto& vExpBase = exponentiation.getBase();
for (auto it = members.begin(); it != members.end();)
{
if (it->IsExponentiation() &&
Expand All @@ -907,7 +907,7 @@ namespace math {
}
else if (vExpBase == *it)
{
Update(it, vExpBase ^ (e.getExponentiation() + 1));
Update(it, vExpBase ^ (exponentiation.getExponentiation() + 1));
goto yes;
}
else
Expand Down
3 changes: 2 additions & 1 deletion omnn/math/Valuable.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ namespace math {

#if !defined(NDEBUG) && !defined(NOOMDEBUG)
if(s.size() > 1){
OptimizeOn oo;
auto distinct = Distinct();
if (distinct != s) {
std::stringstream ss;
Expand Down Expand Up @@ -2103,7 +2104,7 @@ bool Valuable::SerializedStrEqual(const std::string_view& s) const {
if (exp)
return exp->reciprocal();
else {
return Become(Exponentiation{std::move(*this), constants::minus_1});
return Become(Exponentiation{Move(), constants::minus_1});
}
}

Expand Down

0 comments on commit f55c750

Please sign in to comment.