From 18d8d093ab2d24e35a0bf1f603774baa46ff28f2 Mon Sep 17 00:00:00 2001 From: "Franz R. Sattler" Date: Wed, 15 Jan 2025 23:26:51 +0100 Subject: [PATCH] fix: shorten sign function Signed-off-by: Franz R. Sattler --- DiFfRG/include/DiFfRG/common/math.hh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/DiFfRG/include/DiFfRG/common/math.hh b/DiFfRG/include/DiFfRG/common/math.hh index f47f85f..8c41e1a 100644 --- a/DiFfRG/include/DiFfRG/common/math.hh +++ b/DiFfRG/include/DiFfRG/common/math.hh @@ -92,8 +92,7 @@ namespace DiFfRG */ template constexpr __forceinline__ __host__ __device__ double sign(const NumberType x) { - if (x >= 0) return 1.; - return -1.; + return x >= 0. ? 1. : -1.; } /**