[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: mathlib
- From: Leo Razoumov <slonik.az@...>
- Date: Wed, 23 Apr 2014 16:37:01 -0400
On 4/4/14, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>> So far the costs were discussed, what are the expected gains? Smaller
>> size? How much? Any insights?
>
> It is more a question of principles :)
>
> In the old days (C89), it was easier to draw the line. Many functions in
> the C math library seem useful and familiar (exp, sin, cos, tan, etc.);
> even if there were a few not that common (like the hyperbolic ones), they
> were only a few, and so the simplest thing to do was to add them all
> to Lua's math lib.
>
> Now, with C99, things are much more complex. First, there are many
> more extra functions (not only in math.h but also those in fenv.h and
> probably some others). Second, they are not available in all platforms
> (our target is still C89, as much as possible). If we are to support
> them all, sizes get larger and portability suffers. On the other hand,
> if we do not add them all, where is the line?
Roberto,
the historic prospective can serve as a nice guideline to where
to 'draw the line'. Whatever math functions were already included
in C89 standard library should continue to exist in Lua's math lib
going forward. Besides, hyperbolic functions such as sinh, cosh, tanh,
etc are heavily used in the fields of statistics (logistic regression),
signal processing (log-likelihood ratios), geometry, image transformations,
etc.
--Leo--