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