Commit c4a64884 authored by Lefebvre, Jordan's avatar Lefebvre, Jordan
Browse files

Merge branch 'decaydeb' into 'master'

Adding divide by zero checks in decaydb.

See merge request !85
parents 63954f61 9e3f6440
Pipeline #71882 passed with stages
in 17 minutes and 25 seconds
......@@ -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