Skip to content

Commit

Permalink
fix: shorten sign function
Browse files Browse the repository at this point in the history
Signed-off-by: Franz R. Sattler <[email protected]>
  • Loading branch information
Franz R. Sattler committed Jan 15, 2025
1 parent 9a7fe2f commit 18d8d09
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions DiFfRG/include/DiFfRG/common/math.hh
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ namespace DiFfRG
*/
template <typename NumberType> constexpr __forceinline__ __host__ __device__ double sign(const NumberType x)
{
if (x >= 0) return 1.;
return -1.;
return x >= 0. ? 1. : -1.;
}

/**
Expand Down

0 comments on commit 18d8d09

Please sign in to comment.