Fix log(0.0) bug by using list comprehensions and float() casting.