Skip to content

Commit

Permalink
Make comparison slightly more readable by inserting spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
hageboeck committed Oct 8, 2024
1 parent eb307b9 commit f5f9e86
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions talk/expert/cpp20concepts.tex
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<typename T,
typename = std::enable_if_t<std::is_floating_point_v<T>>>
bool equal( T e1, T e2 ) {
return std::abs(e1-e2)<std::numeric_limits<T>::epsilon();
return std::abs(e1-e2) < std::numeric_limits<T>::epsilon();
}
... equal(10,5+5) ...
\end{cppcode*}
Expand Down Expand Up @@ -62,7 +62,7 @@
template<typename T>
requires std::is_floating_point_v<T>
bool equal( T e1, T e2 ) {
return std::abs(e1-e2)<std::numeric_limits<T>::epsilon();
return std::abs(e1-e2) < std::numeric_limits<T>::epsilon();
}
... equal(10,5+5) ...
\end{cppcode*}
Expand Down Expand Up @@ -119,7 +119,7 @@
template< typename T>
concept MyFloatingPoint =
std::is_floating_point_v<T> &&
std::numeric_limits<T>::epsilon()>0;
std::numeric_limits<T>::epsilon() > 0;

template<typename T>
requires MyFloatingPoint<T>
Expand Down

0 comments on commit f5f9e86

Please sign in to comment.