Skip to content

Commit

Permalink
Merge pull request #1100 from ShikharJ/Issue1089
Browse files Browse the repository at this point in the history
A Better Update to Issue #1089
  • Loading branch information
isuruf committed Oct 26, 2016
2 parents 2f5853b + f5c147d commit d178e40
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
6 changes: 3 additions & 3 deletions symengine/infinity.cpp
Expand Up @@ -129,9 +129,9 @@ RCP<const Number> Infty::mul(const Number &other) const
RCP<const Number> Infty::div(const Number &other) const
{
if (is_a<Infty>(other)) {
throw UndefinedError("Indeterminate Expression: "
"`Infty / Infty` "
"encountered");
throw DomainError("Indeterminate Expression: "
"`Infty / Infty` "
"encountered");
} else {
if (other.is_positive())
return rcp_from_this_cast<Number>();
Expand Down
2 changes: 1 addition & 1 deletion symengine/series_generic.cpp
Expand Up @@ -104,7 +104,7 @@ UExprDict UnivariateSeries::pow(const UExprDict &base, int exp, unsigned prec)
}
if (exp == 0) {
if (base == 0 or base.get_dict().size() == 0) {
throw UndefinedError("Error: 0**0 is undefined.");
throw DomainError("Error: 0**0 is undefined.");
} else {
return UExprDict(1);
}
Expand Down
8 changes: 4 additions & 4 deletions symengine/symengine_exception.h
Expand Up @@ -6,7 +6,7 @@ typedef enum {
SYMENGINE_RUNTIME_ERROR = 1,
SYMENGINE_DIV_BY_ZERO = 2,
SYMENGINE_NOT_IMPLEMENTED = 3,
SYMENGINE_UNDEFINED = 4,
SYMENGINE_DOMAIN_ERROR = 4,
SYMENGINE_PARSE_ERROR = 5,
} symengine_exceptions_t;

Expand Down Expand Up @@ -57,11 +57,11 @@ class NotImplementedError : public SymEngineException
}
};

class UndefinedError : public SymEngineException
class DomainError : public SymEngineException
{
public:
UndefinedError(const std::string &msg)
: SymEngineException(msg, SYMENGINE_UNDEFINED)
DomainError(const std::string &msg)
: SymEngineException(msg, SYMENGINE_DOMAIN_ERROR)
{
}
};
Expand Down
4 changes: 2 additions & 2 deletions symengine/tests/basic/test_series_generic.cpp
Expand Up @@ -31,7 +31,7 @@ using SymEngine::Number;
using SymEngine::umap_int_basic;
using SymEngine::pi;
using SymEngine::I;
using SymEngine::UndefinedError;
using SymEngine::DomainError;
using SymEngine::NotImplementedError;
using SymEngine::SymEngineException;
using SymEngine::gamma;
Expand Down Expand Up @@ -164,7 +164,7 @@ TEST_CASE("Exponentiation of UExprDict with precision", "[UnivariateSeries]")
REQUIRE(e == c);
REQUIRE(f == d);
REQUIRE(g == one);
REQUIRE_THROWS_AS(UnivariateSeries::pow(zero, 0, 1), UndefinedError);
REQUIRE_THROWS_AS(UnivariateSeries::pow(zero, 0, 1), DomainError);
}

TEST_CASE("Differentiation of UnivariateSeries", "[UnivariateSeries]")
Expand Down

0 comments on commit d178e40

Please sign in to comment.