MCPcopy Create free account
hub / github.com/BoevaLab/FREEC / operator/

Method operator/

src/ap.cpp:76–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74{ return ap::complex(lhs*rhs.x, lhs*rhs.y); }
75
76const ap::complex ap::operator/(const ap::complex& lhs, const ap::complex& rhs)
77{
78 ap::complex result;
79 double e;
80 double f;
81 if( fabs(rhs.y)<fabs(rhs.x) )
82 {
83 e = rhs.y/rhs.x;
84 f = rhs.x+rhs.y*e;
85 result.x = (lhs.x+lhs.y*e)/f;
86 result.y = (lhs.y-lhs.x*e)/f;
87 }
88 else
89 {
90 e = rhs.x/rhs.y;
91 f = rhs.y+rhs.x*e;
92 result.x = (lhs.y+lhs.x*e)/f;
93 result.y = (-lhs.x+lhs.y*e)/f;
94 }
95 return result;
96}
97
98const ap::complex ap::operator/(const double& lhs, const ap::complex& rhs)
99{

Callers

nothing calls this directly

Calls 1

complexClass · 0.85

Tested by

no test coverage detected