[GRASS-git] [OSGeo/grass] 79e0ca: i.gensigset: fix possible pole and divide by zero ...
Mohan Yelugoti
noreply at github.com
Sat Jun 28 04:22:57 PDT 2025
Branch: refs/heads/main
Home: https://github.com/OSGeo/grass
Commit: 79e0ca09afef9b5fcdd7d6c3be532146e6d0a4b9
https://github.com/OSGeo/grass/commit/79e0ca09afef9b5fcdd7d6c3be532146e6d0a4b9
Author: Mohan Yelugoti <ymdatta.work at gmail.com>
Date: 2025-06-28 (Sat, 28 Jun 2025)
Changed paths:
M imagery/i.gensigset/subcluster.c
Log Message:
-----------
i.gensigset: fix possible pole and divide by zero errors in regroup (#4500)
* i.gensigset: fix possible pole and divide by zero errors in regroup
Using logarithm function call with zero argument will lead to
a pole error, which occurs if the mathematical function has
an exact infinite result.
Check if the argument value is zero before passing that to
the log function to avoid such errors. I also added check
for negative numbers just to make sure the argument is in
the right domain for the log function as well.
There was also a possible divide by zero scenario when we
were dividing the class data by subsum, which can be zero.
Added a conditional check which avoids going to that stage.
Signed-off-by: Mohan Yelugoti <ymdatta.work at gmail.com>
---------
Signed-off-by: Mohan Yelugoti <ymdatta.work at gmail.com>
To unsubscribe from these emails, change your notification settings at https://github.com/OSGeo/grass/settings/notifications
More information about the grass-commit
mailing list