Some core plug-ins report negative progress values in large experiments
Description (last modified by )
In experiments where the number of spots is larger than ~20M, the progress reporter for some plug-ins (Lowess and possible all other core plug-ins), suddenly wraps around and starts reporting negative values. This is caused by the way the progress is calculated:
int progress = (normalizedSpots * 100) / numSpots;
The problem is that the multiplication by 100 is done before the division. The multiplication causes the int value to wrap around to the negative side if the value is bigger than ~20M. The fix is not simply to do the division first. Since it is an integer division it will always yield 0 or 1 as the result. So, we either have to do the multiplication with 'long' values or do the division with 'float' values.
See also #865 for a suggested solution to make the progress reporter more stable.
Note! There is no real harm done in reporting negative values. Everything will still work, though it may look a bit strange to users and also make them unsure if it really is working or if some nasty error has occurred.