Skip to content

Commit

Permalink
User std::abs (pyne#792)
Browse files Browse the repository at this point in the history
  • Loading branch information
dschwen committed Dec 22, 2015
1 parent 2997735 commit 17945a7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/data.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1441,17 +1441,17 @@ int pyne::id_from_level(int nuc, double level, std::string special) {
int ret_id = nuc;
for (std::map<std::pair<int, double>, level_data>::iterator it=nuc_lower;
it!=nuc_upper; ++it) {
if ((abs(level - it->second.level) < minv) &&
if ((std::abs(level - it->second.level) < minv) &&
((char)it->second.special == special.c_str()[0]) &&
!isnan(it->second.level)) {
minv = abs(level - it->second.level);
minv = std::abs(level - it->second.level);
ret_id = it->second.nuc_id;
}
}
// This value was chosen so important transitions in U-235 are not missed
if (minv > 3.0)
return -nuc;
else
else
return ret_id;
}

Expand Down

0 comments on commit 17945a7

Please sign in to comment.