3#ifndef XCMATH_COMPLEX_H
4#define XCMATH_COMPLEX_H
9#include "../utils/compiling.hpp"
10#include "../utils/concepts.h"
19 static constexpr auto Type = TypeName<T>;
23 requires std::is_default_constructible_v<T>
26 requires std::is_default_constructible_v<T>
29 template <
typename Vtp2>
30 requires std::convertible_to<Vtp2, T>
33 template <
typename Vtp1>
34 requires std::convertible_to<Vtp1, T>
48 requires concepts::Minus<T>
56 real * other.imag +
imag * other.real);
61 return *
this * other.inv();
63 template <
typename Res =
double>
65 requires concepts::Sqrt<T>
70 requires concepts::Divide<T>
76 requires std::convertible_to<T, V>
Complex number class template
complex(const T &real, const Vtp2 &imag)
static constexpr auto Type
complex(const Vtp1 &real, const T &imag)
complex operator/(const complex &other) const
complex(const T &real, const T &imag)
complex operator-(const complex &other) const
complex operator+(const complex &other) const
complex operator*(const complex &other) const
complex operator-() const
Compiler-specific type information handling for MSVC