Definition at line 26 of file Time.h.
#include <Time.h>
◆ Time()
| NumLib::Time::Time |
( |
double const | time | ) |
|
|
inlineexplicitconstexpr |
◆ operator()()
| double NumLib::Time::operator() |
( |
| ) |
const |
|
inlineconstexpr |
◆ operator+()
| Time NumLib::Time::operator+ |
( |
double const | increment | ) |
const |
|
inlineconstexpr |
Definition at line 38 of file Time.h.
39 {
41 result += increment;
42 return result;
43 }
constexpr Time(double const time)
References Time().
◆ operator+=()
| Time & NumLib::Time::operator+= |
( |
double const | increment | ) |
|
|
inlineconstexpr |
◆ operator-()
| Time NumLib::Time::operator- |
( |
double const | decrement | ) |
const |
|
inlineconstexpr |
Definition at line 51 of file Time.h.
52 {
54 result -= decrement;
55 return result;
56 }
References Time().
◆ operator-=()
| Time & NumLib::Time::operator-= |
( |
double const | decrement | ) |
|
|
inlineconstexpr |
◆ operator<=>()
| std::weak_ordering NumLib::Time::operator<=> |
( |
Time const & | b | ) |
const |
|
inlineconstexpr |
Definition at line 58 of file Time.h.
59 {
60 Time const& a = *
this;
61 double const diff = b() - a();
62
63 double const eps = 10 * std::numeric_limits<double>::epsilon() *
64 std::max(1., (std::abs(a()) + std::abs(b())) / 2);
65
66
67
68
69
70 if (diff < -eps)
71 {
72 return std::weak_ordering::greater;
73 }
74 if (diff > eps)
75 {
76 return std::weak_ordering::less;
77 }
78 return std::weak_ordering::equivalent;
79 }
References Time().
◆ operator==()
| bool NumLib::Time::operator== |
( |
Time const & | x | ) |
const |
|
inlineconstexpr |
Definition at line 81 of file Time.h.
82 {
83 return (*this <=> x) == std::weak_ordering::equivalent;
84 }
References Time().
◆ operator<<
| std::ostream & operator<< |
( |
std::ostream & | os, |
|
|
Time const & | t ) |
|
friend |
Definition at line 86 of file Time.h.
87 {
88 auto const precision = os.precision();
89 return os << std::setprecision(
90 std::numeric_limits<double>::max_digits10)
91 << t() << std::setprecision(precision);
92 }
References Time().
◆ value_
The documentation for this struct was generated from the following file: