[erlang-questions] Erlang documentation -- a modest proposal
Tue Sep 27 01:10:13 CEST 2016
On 26 September 2016 11:53:57 GMT+10:00, "Richard A. O'Keefe" <> wrote:
> if x > 0 then exp(log(x)) is approximately equal to x
> if |x| <= 709 then log(exp(x)) is approximately equal to x.
>But neither of these is a fact about log(), so they don't belong
>in src/libm/src/C/log.c, and neither of these is a fact about
>exp(), so they don't belong in src/libm/src/C/exp.c either.
>They belong in a documentation file about the elementary
>transcendental functions as a group, and there is no one source
>file corresponding to that. (log.c and exp.c have detailed
>internal documentation, which users benefit from NOT seeing,
>except for the accuracy results.)
>For that matter, log() and clog() aren't even in the same
>header, yet I would like to see them documented together.
The documentation and proofs for these properties would go into tests. The tools should support documentation extraction from test modules. This has a benefit when properties change the tests have to also be updated along with the documentation.
More information about the erlang-questions