Skip to content

Commit

Permalink
Correct initialization of Max
Browse files Browse the repository at this point in the history
FLT_MIN is the smallest positive float
  • Loading branch information
gvellut committed Feb 29, 2016
1 parent e097d6e commit 8a47b5c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/analysis/vector/qgszonalstatistics.h
Expand Up @@ -67,7 +67,7 @@ class ANALYSIS_EXPORT QgsZonalStatistics
{
reset();
}
void reset() { sum = 0; count = 0; max = FLT_MIN; min = FLT_MAX; valueCount.clear(); values.clear(); }
void reset() { sum = 0; count = 0; max = -FLT_MAX; min = FLT_MAX; valueCount.clear(); values.clear(); }
void addValue( float value, double weight = 1.0 )
{
if ( weight < 1.0 )
Expand Down

0 comments on commit 8a47b5c

Please sign in to comment.