Update moduloOrZero.cpp

This commit is contained in:
alexey-milovidov 2020-07-21 17:07:09 +03:00 committed by GitHub
parent b358c796f1
commit 72280ee2a3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,6 +16,7 @@ struct ModuloOrZeroImpl
{
if constexpr (std::is_floating_point_v<ResultType>)
{
/// This computation is similar to `fmod` but the latter is not inlined and has 40 times worse performance.
return ResultType(a) - trunc(ResultType(a) / ResultType(b)) * ResultType(b);
}
else