summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-03-07 11:41:53 +0100
committerStanislaw Halik <sthalik@misaki.pl>2024-03-07 11:41:53 +0100
commit4e9dcd1697948f581be0f85c6d6d6670c61c09f5 (patch)
tree61bbe5e83f5310c0da7b693aa816c30673053fbc
parentbf6172257cc8900476bb95f721a42ae534876340 (diff)
remove Ns multiplication with single-precision floats
-rw-r--r--src/nanosecond.hpp1
-rw-r--r--src/nanosecond.inl12
2 files changed, 0 insertions, 13 deletions
diff --git a/src/nanosecond.hpp b/src/nanosecond.hpp
index 94c30ba3..cd5f1eec 100644
--- a/src/nanosecond.hpp
+++ b/src/nanosecond.hpp
@@ -21,7 +21,6 @@ struct Ns
template<typename T> requires (std::is_integral_v<T> && std::is_unsigned_v<T>) friend constexpr Ns operator*(const Ns& lhs, T rhs);
template<typename T> requires (std::is_integral_v<T> && std::is_signed_v<T> && sizeof(T) < sizeof(uint64_t)) friend constexpr Ns operator*(const Ns&, T);
template<typename T> friend constexpr Ns operator*(T lhs, const Ns& rhs);
- template<typename T> requires std::is_same_v<float, T> friend constexpr Ns operator*(const Ns& lhs, T rhs);
friend constexpr uint64_t operator/(const Ns& lhs, const Ns& rhs);
friend constexpr Ns operator/(const Ns& lhs, uint64_t b);
diff --git a/src/nanosecond.inl b/src/nanosecond.inl
index 6527dc02..5f93a409 100644
--- a/src/nanosecond.inl
+++ b/src/nanosecond.inl
@@ -60,18 +60,6 @@ constexpr Ns operator*(T lhs, const Ns& rhs)
return rhs * lhs;
}
-template<typename T>
-requires std::is_same_v<float, T>
-constexpr Ns operator*(const Ns& lhs, T rhs)
-{
- constexpr float max{uint64_t{1} << 24};
- auto a = lhs.stamp;
- auto x = float(a) * float{rhs};
- fm_assert(x >= 0);
- fm_assert(x <= max);
- return Ns{uint64_t(x)};
-}
-
constexpr uint64_t operator/(const Ns& lhs, const Ns& rhs)
{
auto a = lhs.stamp, b = rhs.stamp;