lua-users home
lua-l archive

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


2014-04-03 22:35 GMT+02:00 Roberto Ierusalimschy <roberto@inf.puc-rio.br>:
> We are considering removing some functions from the standard math lib,
> either because we think few people use them or because they are trivially
> implemented without the library. The current list is this:
>
> - sinh, cosh, tanh: (They are quite specialized, on par with several
> other functions offered by external libraries, such as lhf's mathlibx.)

Few people, maybe, but the sort of people that I hope you wish to
retain as Lua users. If you remove them, you may as well say:

    If you thought of using Lua for serious scientific work, forget it.

On the contrary, I would suggest _adding_ the subset of functions from
mathlibx that seem to be omitted from Lua only because C99 has them
but C89 does not, e.g. asinh, acosh, atanh. I'll stop short of demanding
"complex", though. :-)

There are subtle numeric reasons why you can't trivially implement them. [1]
Not everybody is aware that there is a problem, let alone how to fix it.
The Lua math library is the ideal place to have that expertise pre-digested.

1] http://www.plunk.org/~hatch/rightway.php

> - deg, rad, pow: trivially done without the library.

These may go. They are remnants of languages that have neither
an exponentiation operator nor math.pi.