From f5f9e86351c2b034d2329a11f31e69cbcd589729 Mon Sep 17 00:00:00 2001 From: Stephan Hageboeck Date: Fri, 4 Oct 2024 12:02:24 +0200 Subject: [PATCH] Make comparison slightly more readable by inserting spaces. --- talk/expert/cpp20concepts.tex | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/talk/expert/cpp20concepts.tex b/talk/expert/cpp20concepts.tex index 669c2256..7dd807ad 100644 --- a/talk/expert/cpp20concepts.tex +++ b/talk/expert/cpp20concepts.tex @@ -27,7 +27,7 @@ >> bool equal( T e1, T e2 ) { - return std::abs(e1-e2)::epsilon(); + return std::abs(e1-e2) < std::numeric_limits::epsilon(); } ... equal(10,5+5) ... \end{cppcode*} @@ -62,7 +62,7 @@ template requires std::is_floating_point_v bool equal( T e1, T e2 ) { - return std::abs(e1-e2)::epsilon(); + return std::abs(e1-e2) < std::numeric_limits::epsilon(); } ... equal(10,5+5) ... \end{cppcode*} @@ -119,7 +119,7 @@ template< typename T> concept MyFloatingPoint = std::is_floating_point_v && - std::numeric_limits::epsilon()>0; + std::numeric_limits::epsilon() > 0; template requires MyFloatingPoint