I want to calculate the entropy of a time series, but I found that in the way, there are some infinities arising from a log(0). In this particular case, those zeros represent a frequency with amplitude zero. That's just a bit of context. What I really want to know is the following:
What is the proper way to deal with infinities or zeros propagating through calculations in scientific programming? I have seen that sometimes a very small quantity is added to avoid this issue. Is this a general solution? I think there could be some issues when requiring a very precise calculation. Are there other solutions?