Complexity Shock Horror II: the Sequel (was Re: MD5 in erlang .)
Mon Mar 31 14:50:43 CEST 2003
On Thu, 27 Mar 2003, James Hague wrote:
> I've often thought Erlang should have the BIFs:
> integer_to_list(Base, Integer)
> list_to_integer(Base, List)
> In addition to the arity-1 versions that currently exist.
What what what .... wot ... what's this all this integer stuff ..
If we generalise over non-integer bases to can easily make (say) an
avoirdupois converter, so that:
would then convert 456789 drams to
and so on ... *very* useful for calculating with common units -
think about it for a few micro-Fortnight's ....
Non-integer bases would give logs and things
Ln = fun(X) -> list_to_number(10, number_to_base(2.7138, X)) end,
We could then have base pi numbers for easy calculation of geometric
And negative bases would give complex numbers, etc
More information about the erlang-questions