1#include <vanetza/common/unit_interval.hpp>
11 m_value += other.m_value;
17 m_value -= other.m_value;
23 m_value *= other.m_value;
30 m_value /= other.m_value;
32 m_value = std::min(m_value, 1.0);
60bool UnitInterval::operator<(
const UnitInterval& other)
const
62 return m_value < other.m_value;
65bool UnitInterval::operator==(
const UnitInterval& other)
const
68 return std::abs(m_value - other.m_value) < std::numeric_limits<double>::epsilon();
73 m_value = clamp(m_value);
79 UnitInterval complement;
80 complement.m_value = 1.0 - m_value;
86 return UnitInterval { 0.5 * (lhs.value() + rhs.value()) };