Skip to content
Snippets Groups Projects
Commit 50a38d33 authored by Studer Gabriel's avatar Studer Gabriel
Browse files

define variable (gives compiler warning otherwise) and avoid zero division

parent ab2b0a17
Branches
Tags
No related merge requests found
......@@ -103,7 +103,7 @@ void Argand::update_buffer()
pnt.drawLine(0,p0.y(),size().width(),p0.y());
if (!has_data_ || GetObservedData().GetType()!=COMPLEX) return;
Real maxlen;
Real maxlen = 0.0;
std::vector<Complex> data_list;
for(ExtentIterator it(extent_); !it.AtEnd(); ++it) {
Complex v = GetObservedData().GetComplex(it);
......@@ -113,6 +113,10 @@ void Argand::update_buffer()
data_list.push_back(v);
}
if(maxlen == 0.0) {
return; // return to avoid zero division
}
int dim=std::min(size().width(),size().height());
sf_=0.5*(Real)(dim-10)/maxlen;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment