Opened 9 years ago

Closed 9 years ago

Last modified 9 years ago

#5723 closed defect (invalid)

Overflow in Average Interpolation

Reported by: johanstenberg Owned by: warmerdam
Priority: low Milestone:
Component: Algorithms Version: svn-trunk
Severity: minor Keywords:
Cc:

Description

Change History (7)

comment:1 by johanstenberg, 9 years ago

Resolution: invalid
Status: newclosed

comment:2 by johanstenberg, 9 years ago

Resolution: invalid
Status: closedreopened

comment:3 by Even Rouault, 9 years ago

Resolution: invalid
Status: reopenedclosed

I don't think so. This is a double variable.

comment:4 by johanstenberg, 9 years ago

I don't really know the ins and outs of C++ but in Java for example, Double.MAX_VALUE + Double.MAX_VALUE leads to Double.Infinity. The same code in C++:

double d = numeric_limits<double>::max(); double c = d + d; cout << c << endl;

Leads to "inf" being printed. I just wanted to let you know.

comment:5 by johanstenberg, 9 years ago

My point here is that if you have a raster with all numeric_limits<double>::max() / 2, it will overflow and not yield the, computable, average.

comment:6 by Even Rouault, 9 years ago

ah I see. Hou have seen any such raster using the maximum double value or approachig values ? That would be a pain to deal with.

comment:7 by johanstenberg, 9 years ago

I don't have a raster, I was just reading through the source and thought about it. This algorithm fixes the issue: http://www.heikohoffmann.de/htmlthesis/node134.html.

Note: See TracTickets for help on using tickets.