Opened 7 years ago

Closed 7 years ago

Last modified 7 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 Changed 7 years ago by johanstenberg

Resolution: invalid
Status: newclosed

comment:2 Changed 7 years ago by johanstenberg

Resolution: invalid
Status: closedreopened

comment:3 Changed 7 years ago by Even Rouault

Resolution: invalid
Status: reopenedclosed

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

comment:4 Changed 7 years ago by johanstenberg

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 Changed 7 years ago by johanstenberg

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 Changed 7 years ago by Even Rouault

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 Changed 7 years ago by johanstenberg

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.