template<
unsigned int Precision>
const campf<Precision>
operator+ (
const signed type& op1,
const campf<Precision>& op2) {
return campf<Precision>(op1+op2.x, op2.y); } \
template<
unsigned int Precision>
const campf<Precision>
operator+ (
const unsigned type& op1,
const campf<Precision>& op2) {
return campf<Precision>(op1+op2.x, op2.y); } \
template<
unsigned int Precision>
const campf<Precision>
operator+ (
const campf<Precision>& op1,
const signed type& op2) {
return campf<Precision>(op1.x+op2, op1.y); } \
template<
unsigned int Precision>
const campf<Precision>
operator+ (
const campf<Precision>& op1,
const unsigned type& op2) {
return campf<Precision>(op1.x+op2, op1.y); } \
template<
unsigned int Precision>
const campf<Precision>
operator- (
const signed type& op1,
const campf<Precision>& op2) {
return campf<Precision>(op1-op2.x, -op2.y); } \
template<
unsigned int Precision>
const campf<Precision>
operator- (
const unsigned type& op1,
const campf<Precision>& op2) {
return campf<Precision>(op1-op2.x, -op2.y); } \
template<
unsigned int Precision>
const campf<Precision>
operator- (
const campf<Precision>& op1,
const signed type& op2) {
return campf<Precision>(op1.x-op2, op1.y); } \
template<
unsigned int Precision>
const campf<Precision>
operator- (
const campf<Precision>& op1,
const unsigned type& op2) {
return campf<Precision>(op1.x-op2, op1.y); } \
template<
unsigned int Precision>
const campf<Precision>
operator* (
const signed type& op1,
const campf<Precision>& op2) {
return campf<Precision>(op1*op2.x, op1*op2.y); } \
template<
unsigned int Precision>
const campf<Precision>
operator* (
const unsigned type& op1,
const campf<Precision>& op2) {
return campf<Precision>(op1*op2.x, op1*op2.y); } \
template<
unsigned int Precision>
const campf<Precision>
operator* (
const campf<Precision>& op1,
const signed type& op2) {
return campf<Precision>(op2*op1.x, op2*op1.y); } \
template<
unsigned int Precision>
const campf<Precision>
operator* (
const campf<Precision>& op1,
const unsigned type& op2) {
return campf<Precision>(op2*op1.x, op2*op1.y); } \
template<
unsigned int Precision>
const campf<Precision>
operator/ (
const signed type& op1,
const campf<Precision>& op2) {
return campf<Precision>(ampf<Precision>(op1),ampf<Precision>(0))/op2; } \
template<
unsigned int Precision>
const campf<Precision>
operator/ (
const unsigned type& op1,
const campf<Precision>& op2) {
return campf<Precision>(ampf<Precision>(op1),ampf<Precision>(0))/op2; } \
template<
unsigned int Precision>
const campf<Precision>
operator/ (
const campf<Precision>& op1,
const signed type& op2) {
return campf<Precision>(op1.x/op2, op1.y/op2); } \
template<
unsigned int Precision>
const campf<Precision>
operator/ (
const campf<Precision>& op1,
const unsigned type& op2) {
return campf<Precision>(op1.x/op2, op1.y/op2); } \
template<
unsigned int Precision>
bool operator==(
const signed type& op1,
const campf<Precision>& op2) {
return op1==op2.x && op2.y==0; } \
template<
unsigned int Precision>
bool operator==(
const unsigned type& op1,
const campf<Precision>& op2) {
return op1==op2.x && op2.y==0; } \
template<
unsigned int Precision>
bool operator==(
const campf<Precision>& op1,
const signed type& op2) {
return op1.x==op2 && op1.y==0; } \
template<
unsigned int Precision>
bool operator==(
const campf<Precision>& op1,
const unsigned type& op2) {
return op1.x==op2 && op1.y==0; } \
template<
unsigned int Precision>
bool operator!=(
const campf<Precision>& op1,
const signed type& op2) {
return op1.x!=op2 || op1.y!=0; } \
template<
unsigned int Precision>
bool operator!=(
const campf<Precision>& op1,
const unsigned type& op2) {
return op1.x!=op2 || op1.y!=0; } \
template<
unsigned int Precision>
bool operator!=(
const signed type& op1,
const campf<Precision>& op2) {
return op1!=op2.x || op2.y!=0; } \
template<
unsigned int Precision>
bool operator!=(
const unsigned type& op1,
const campf<Precision>& op2) {
return op1!=op2.x || op2.y!=0; }
848 #define __AMP_BINARY_OPI(type) \
849 template<unsigned int Precision> const ampf<Precision> operator+(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)+op2; } \
850 template<unsigned int Precision> const ampf<Precision> operator+(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)+op2; } \
851 template<unsigned int Precision> const ampf<Precision> operator+(const ampf<Precision>& op1, const signed type& op2) { return op1+ampf<Precision>(op2); } \
852 template<unsigned int Precision> const ampf<Precision> operator+(const ampf<Precision>& op1, const unsigned type& op2) { return op1+ampf<Precision>(op2); } \
853 template<unsigned int Precision> const ampf<Precision> operator-(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)-op2; } \
854 template<unsigned int Precision> const ampf<Precision> operator-(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)-op2; } \
855 template<unsigned int Precision> const ampf<Precision> operator-(const ampf<Precision>& op1, const signed type& op2) { return op1-ampf<Precision>(op2); } \
856 template<unsigned int Precision> const ampf<Precision> operator-(const ampf<Precision>& op1, const unsigned type& op2) { return op1-ampf<Precision>(op2); } \
857 template<unsigned int Precision> const ampf<Precision> operator*(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)*op2; } \
858 template<unsigned int Precision> const ampf<Precision> operator*(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)*op2; } \
859 template<unsigned int Precision> const ampf<Precision> operator*(const ampf<Precision>& op1, const signed type& op2) { return op1*ampf<Precision>(op2); } \
860 template<unsigned int Precision> const ampf<Precision> operator*(const ampf<Precision>& op1, const unsigned type& op2) { return op1*ampf<Precision>(op2); } \
861 template<unsigned int Precision> const ampf<Precision> operator/(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)/op2; } \
862 template<unsigned int Precision> const ampf<Precision> operator/(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)/op2; } \
863 template<unsigned int Precision> const ampf<Precision> operator/(const ampf<Precision>& op1, const signed type& op2) { return op1/ampf<Precision>(op2); } \
864 template<unsigned int Precision> const ampf<Precision> operator/(const ampf<Precision>& op1, const unsigned type& op2) { return op1/ampf<Precision>(op2); } \
865 template<unsigned int Precision> const bool operator==(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)==op2; } \
866 template<unsigned int Precision> const bool operator==(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)==op2; } \
867 template<unsigned int Precision> const bool operator==(const ampf<Precision>& op1, const signed type& op2) { return op1==ampf<Precision>(op2); } \
868 template<unsigned int Precision> const bool operator==(const ampf<Precision>& op1, const unsigned type& op2) { return op1==ampf<Precision>(op2); } \
869 template<unsigned int Precision> const bool operator!=(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)!=op2; } \
870 template<unsigned int Precision> const bool operator!=(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)!=op2; } \
871 template<unsigned int Precision> const bool operator!=(const ampf<Precision>& op1, const signed type& op2) { return op1!=ampf<Precision>(op2); } \
872 template<unsigned int Precision> const bool operator!=(const ampf<Precision>& op1, const unsigned type& op2) { return op1!=ampf<Precision>(op2); } \
873 template<unsigned int Precision> const bool operator<=(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)<=op2; } \
874 template<unsigned int Precision> const bool operator<=(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)<=op2; } \
875 template<unsigned int Precision> const bool operator<=(const ampf<Precision>& op1, const signed type& op2) { return op1<=ampf<Precision>(op2); } \
876 template<unsigned int Precision> const bool operator<=(const ampf<Precision>& op1, const unsigned type& op2) { return op1<=ampf<Precision>(op2); } \
877 template<unsigned int Precision> const bool operator>=(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)>=op2; } \
878 template<unsigned int Precision> const bool operator>=(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)>=op2; } \
879 template<unsigned int Precision> const bool operator>=(const ampf<Precision>& op1, const signed type& op2) { return op1>=ampf<Precision>(op2); } \
880 template<unsigned int Precision> const bool operator>=(const ampf<Precision>& op1, const unsigned type& op2) { return op1>=ampf<Precision>(op2); } \
881 template<unsigned int Precision> const bool operator<(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)<op2; } \
882 template<unsigned int Precision> const bool operator<(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)<op2; } \
883 template<unsigned int Precision> const bool operator<(const ampf<Precision>& op1, const signed type& op2) { return op1<ampf<Precision>(op2); } \
884 template<unsigned int Precision> const bool operator<(const ampf<Precision>& op1, const unsigned type& op2) { return op1<ampf<Precision>(op2); } \
885 template<unsigned int Precision> const bool operator>(const signed type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)>op2; } \
886 template<unsigned int Precision> const bool operator>(const unsigned type& op1, const ampf<Precision>& op2) { return ampf<Precision>(op1)>op2; } \
887 template<unsigned int Precision> const bool operator>(const ampf<Precision>& op1, const signed type& op2) { return op1>ampf<Precision>(op2); } \
888 template<unsigned int Precision> const bool operator>(const ampf<Precision>& op1, const unsigned type& op2) { return op1>ampf<Precision>(op2); }