mirror of
https://github.com/openmc-dev/openmc.git
synced 2026-07-28 14:15:42 -04:00
Make sure to use std::fabs
This commit is contained in:
parent
8af84064ca
commit
1b42fa20c6
1 changed files with 3 additions and 3 deletions
|
|
@ -432,9 +432,9 @@ void RegularMesh::bins_crossed(const Particle* p, std::vector<int>& bins,
|
|||
}
|
||||
|
||||
for (j = 0; j < n; ++j) {
|
||||
if (std::abs(u[j]) < FP_PRECISION) {
|
||||
if (std::fabs(u[j]) < FP_PRECISION) {
|
||||
d(j) = INFTY;
|
||||
} else if (u[j] > 0) {
|
||||
} else if (u[j] > 0.0) {
|
||||
double xyz_cross = lower_left_[j] + ijk0(j) * width_[j];
|
||||
d(j) = (xyz_cross - r0[j]) / u[j];
|
||||
} else {
|
||||
|
|
@ -473,7 +473,7 @@ void RegularMesh::bins_crossed(const Particle* p, std::vector<int>& bins,
|
|||
// surface.
|
||||
xt::xtensor<double, 1> d = xt::zeros<double>({n});
|
||||
for (int j = 0; j < n; ++j) {
|
||||
if (abs(u[j]) < FP_PRECISION) {
|
||||
if (std::fabs(u[j]) < FP_PRECISION) {
|
||||
d(j) = INFTY;
|
||||
} else if (u[j] > 0) {
|
||||
double xyz_cross = lower_left_[j] + ijk0(j) * width_[j];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue