git://www.ginac.de
/
ginac.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a687469
)
- Check *this for zeroness before .invert()ing it.
author
Richard Kreckel
<Richard.Kreckel@uni-mainz.de>
Fri, 4 Aug 2000 16:36:55 +0000
(16:36 +0000)
committer
Richard Kreckel
<Richard.Kreckel@uni-mainz.de>
Fri, 4 Aug 2000 16:36:55 +0000
(16:36 +0000)
ginac/numeric.cpp
patch
|
blob
|
history
diff --git
a/ginac/numeric.cpp
b/ginac/numeric.cpp
index bfa00af6a1b7e81432d3184ec3f4b0c3da70699c..0df296eb944ebb3d558e76e03d95d59f54f84521 100644
(file)
--- a/
ginac/numeric.cpp
+++ b/
ginac/numeric.cpp
@@
-716,7
+716,7
@@
numeric numeric::mul(const numeric & other) const
numeric numeric::div(const numeric & other) const
{
if (::zerop(*other.value))
numeric numeric::div(const numeric & other) const
{
if (::zerop(*other.value))
- throw std::overflow_error("division by zero");
+ throw std::overflow_error("
numeric::div():
division by zero");
return numeric((*value)/(*other.value));
}
return numeric((*value)/(*other.value));
}
@@
-741,6
+741,8
@@
numeric numeric::power(const numeric & other) const
/** Inverse of a number. */
numeric numeric::inverse(void) const
{
/** Inverse of a number. */
numeric numeric::inverse(void) const
{
+ if (::zerop(*value))
+ throw std::overflow_error("numeric::inverse(): division by zero");
return numeric(::recip(*value)); // -> CLN
}
return numeric(::recip(*value)); // -> CLN
}