From: Carsten Niehaus Date: Tue, 17 Oct 2006 13:55:41 +0000 (+0000) Subject: fix logic here, I was doing it the wrong way around X-Git-Tag: v3.80.2~12 X-Git-Url: https://git.rmz.fi/?a=commitdiff_plain;h=2c1112658eda2d58c3387df213606e6aa69f8b92;p=libqmvoc.git fix logic here, I was doing it the wrong way around svn path=/trunk/KDE/kdeedu/libkdeedu/; revision=596434 --- diff --git a/libscience/spectrum.cpp b/libscience/spectrum.cpp index d3c1b0c..0793ed9 100644 --- a/libscience/spectrum.cpp +++ b/libscience/spectrum.cpp @@ -18,7 +18,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * ***************************************************************************/ #include "spectrum.h" - #include "element.h" #include @@ -77,12 +76,10 @@ void Spectrum::adjustIntensities() //check if an adjustment is needed or not if ( maxInt == 1000 ) return; - const double max = ( double ) maxInt; - //now adjust the intensities. foreach ( Spectrum::peak * p, m_peaklist) { - double newInt = max*1000/p->intensity; + double newInt = p->intensity*1000/maxInt; p->intensity = ( int ) round( newInt ); } diff --git a/libscience/spectrum.h b/libscience/spectrum.h index cf06565..5f64103 100644 --- a/libscience/spectrum.h +++ b/libscience/spectrum.h @@ -24,7 +24,6 @@ #include #include -#include class Element;