From 20115d3dcb70e4b1c1677837c1b8e3a087d4b98c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mael=20Rouxel-Labb=C3=A9?= Date: Tue, 10 Dec 2024 17:09:54 +0100 Subject: [PATCH] Use std::clamp --- Kernel_23/include/CGAL/Kernel/function_objects.h | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/Kernel_23/include/CGAL/Kernel/function_objects.h b/Kernel_23/include/CGAL/Kernel/function_objects.h index 71d0f4d5130..c49094aefb2 100644 --- a/Kernel_23/include/CGAL/Kernel/function_objects.h +++ b/Kernel_23/include/CGAL/Kernel/function_objects.h @@ -972,15 +972,7 @@ namespace CommonKernelFunctors { // cosine double dot = to_double(scalar_product(u,v)); - double cosine = dot / product; - - if(cosine > 1.){ - cosine = 1.; - } - if(cosine < -1.){ - cosine = -1.; - } - + double cosine = std::clamp(dot / product, -1., 1.); return std::acos(cosine) * 180./CGAL_PI; }