[MATH] Getting the ln(x) given x

The end goal of this is to create a function to give us the log natural of x, as you probably know. To do this, I am in effect using the following integration:

and then adding f by getting how many times e can be multiplied by itself to be less than a. (es-1 in my code)
I will try reducing unnecessary dividing/multiplying for the integration.


Mostly this is just for fun, so although math.log gives the natural log, I’m trying to create my own function to do the same.

I should rephrase it, math.log(x) does give the natural logarithm, but what I’m doing is creating my own function to do so (mostly for the fun of it), then asking if there are any better methods.

The point of it is to not use the lua/roblox integrated math functions, but to create my own function for it, for the fun of it.

I’m currently using the change of base formula for logs in my logbx(b,x) function where loga is the log natural, but what I am doing here is creating my own “math.log” function.