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