lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 18 January 2013 14:38, Dirk Laurie <dirk.laurie@gmail.com> wrote:
> There's no math.asinh, math.acosh, math.atanh.
>
> The reason presumably being that ANSI C does not provide
> them.
>
> But if your C compiler provides it, you may find the included
> file useful.

Or
math.asinh = function (x) return math.log(x + math.sqrt(x * x + 1)); end
math.acosh = function (x) return math.log(x + math.sqrt(x * x - 1)); end
math.atanh = function(x) return (math.log(1 + x) - math.log(1 - x)) / 2; end

   M