mirror of
https://gitlab.com/libeigen/eigen.git
synced 2026-04-10 11:34:33 +08:00
Fix three more flaky tests: igamma, tensor_random, matrix_power
libeigen/eigen!2268 Co-authored-by: Rasmus Munk Larsen <rmlarsen@gmail.com>
This commit is contained in:
@@ -1165,7 +1165,13 @@ struct igamma_generic_impl {
|
||||
}
|
||||
}
|
||||
|
||||
return igamma_series_impl<Scalar, mode>::run(a, x);
|
||||
Scalar ret = igamma_series_impl<Scalar, mode>::run(a, x);
|
||||
if (mode == VALUE) {
|
||||
// Clamp to [0,1] since accumulated series terms can slightly exceed 1.0
|
||||
// due to floating-point rounding for extreme arguments.
|
||||
return numext::mini(one, numext::maxi(zero, ret));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user