diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 7b7b39630..aedb0d533 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -7,7 +7,7 @@ Since last release **Added:** * Added package parameter to storage (#603, #612, #616) -* Added package parameter to source (#613, #617) +* Added package parameter to source (#613, #617, #621) * Added default keep packaging to reactor (#618, #619) **Changed:** diff --git a/src/source.cc b/src/source.cc index 99b578645..751aaa763 100644 --- a/src/source.cc +++ b/src/source.cc @@ -102,8 +102,9 @@ std::set::Ptr> Source::GetMatlBids( double qty = std::min(target->quantity(), max_qty); // calculate packaging - double bid_qty = context()->GetPackage(package)->GetFillMass(qty); - int n_full_bids = static_cast(std::floor(qty / bid_qty)); + std::pair fill = context()->GetPackage(package)->GetFillMass(qty); + double bid_qty = fill.first; + int n_full_bids = fill.second; Package::ExceedsSplitLimits(n_full_bids); std::vector bids;