Skip to content

Commit

Permalink
refactor(example): one more case for zero found in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
mpusz committed Sep 2, 2023
1 parent 0dd28c1 commit dc0b385
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions example/include/geographic.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ using longitude =
template<class CharT, class Traits, typename T>
std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os, const latitude<T>& lat)
{
if (lat.numerical_value() > 0)
if (lat > mp_units::zero)
return os << "N" << lat.numerical_value();
else
return os << "S" << -lat.numerical_value();
Expand All @@ -83,7 +83,7 @@ std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>&
template<class CharT, class Traits, typename T>
std::basic_ostream<CharT, Traits>& operator<<(std::basic_ostream<CharT, Traits>& os, const longitude<T>& lon)
{
if (lon.numerical_value() > 0)
if (lon > mp_units::zero)
return os << "E" << lon.numerical_value();
else
return os << "W" << -lon.numerical_value();
Expand Down

0 comments on commit dc0b385

Please sign in to comment.