Why am I getting a different value while using the log math function?