Is the math/log behaving as it should?


#1

Hello!

I was just playing around with the math/log objects. And I think there might be a small issue with that object.

When the math/log object is fed with a value of zero the output jumps to -64. It should be just zero(I think). See pic;

Is this how it is supposed to react @johannes ?


#2

log_a(x) (the logarithm in base a of x) is defined as the inverse function of a^x (with a>0)

So it's properly defined for any x > 0

The limit for x -> 0 of log(x) is equal to minus infinity, this means that the logarithm is not defined in zero, but the closer you approach to 0, the bigger the output becomes.

Since infinity is too big to be described with a 32 bit variable some weird stuff can occour. Like that you're seeing


#3

Ahh Cool. I guess it can be fixed with a muxer that turns the input off when equal to zero. That could work I think.


#4

I added a version called math/log2 to the com.lib. as an option to the factory library version.