Commit 9e3f6440 authored by Lefebvre, Jordan's avatar Lefebvre, Jordan
Browse files

Adding divide by zero checks in decaydb.

parent 01cf294c
Pipeline #71878 passed with stages
in 21 minutes
......@@ -13466,21 +13466,21 @@ float DecayDb::calculate_activity(int zaid, float abundance) const
float activity = 0.0f;
const auto& it = mActivation.find(zaid);
if (it != mActivation.end())
if (it != mActivation.end() && it->second.halflife > 0.f)
{
activity = abundance / it->second.halflife;
}
else
{
const auto& it2 = mActinide.find(zaid);
if (it2 != mActinide.end())
if (it2 != mActinide.end() && it2->second.halflife > 0.f)
{
activity = abundance / it2->second.halflife;
}
else
{
const auto& it3 = mFissionProduct.find(zaid);
if (it3 != mFissionProduct.end())
if (it3 != mFissionProduct.end() && it3->second.halflife > 0.f)
{
activity = abundance / it3->second.halflife;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment