mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-08-01 11:06:30 -04:00
Extract magnitude_squared to utility.
This commit is contained in:
parent
de0c884b67
commit
76df4f0369
2 changed files with 9 additions and 9 deletions
|
@ -67,7 +67,6 @@
|
|||
|
||||
#include <cstdint>
|
||||
#include <cstddef>
|
||||
#include <complex>
|
||||
#include <array>
|
||||
#include <string>
|
||||
#include <bitset>
|
||||
|
@ -688,14 +687,6 @@ static void init() {
|
|||
);
|
||||
}
|
||||
|
||||
static inline float magnitude_squared(const std::complex<float> c) {
|
||||
const auto r = c.real();
|
||||
const auto r2 = r * r;
|
||||
const auto i = c.imag();
|
||||
const auto i2 = i * i;
|
||||
return r2 + i2;
|
||||
}
|
||||
|
||||
class EventDispatcher {
|
||||
public:
|
||||
MessageHandlerMap& message_handlers() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue