pica_types: minor cleanup
This commit is contained in:
parent
eddc4a029c
commit
a19166ddec
1 changed files with 5 additions and 4 deletions
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <bit>
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <boost/serialization/access.hpp>
|
#include <boost/serialization/access.hpp>
|
||||||
|
@ -50,7 +51,7 @@ public:
|
||||||
hex = sign;
|
hex = sign;
|
||||||
}
|
}
|
||||||
|
|
||||||
std::memcpy(&res.value, &hex, sizeof(float));
|
res.value = std::bit_cast<float>(hex);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -95,17 +96,17 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr Float<M, E>& operator/=(const Float<M, E>& flt) {
|
constexpr Float<M, E>& operator/=(const Float<M, E>& flt) {
|
||||||
value /= flt.ToFloat32();
|
value = operator/(flt).value;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr Float<M, E>& operator+=(const Float<M, E>& flt) {
|
constexpr Float<M, E>& operator+=(const Float<M, E>& flt) {
|
||||||
value += flt.ToFloat32();
|
value = operator+(flt).value;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
constexpr Float<M, E>& operator-=(const Float<M, E>& flt) {
|
constexpr Float<M, E>& operator-=(const Float<M, E>& flt) {
|
||||||
value -= flt.ToFloat32();
|
value = operator-(flt).value;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue