Possible error in function "template <typename T> T InverseValue(const T & value)" defined in otbMath.h
Mantis Issue 1223, reported by admitriev, assigned to jmichel, created: 2016-05-24
In otbMath.h function InverseValue(const T & value) defined as template T InverseValue(const T & value) { return ((value > 0 || value > 0) ? 1/value : 0); } I guess that function should return inverse value of its argument including negative values of the argument. But it is not true possible due to misprint when the "value" compared with 0. It should be noted that this function returns 0 for any values of integer types except value 1.
1464247611 - julienFixed here: https://git.orfeo-toolbox.org/otb.git/commitdiff/b5e5ec1238061bbd5ed542d12afe5159217b3c11
Thanks for reporting.