Complexity Shock Horror II: the Sequel (was Re: MD5 in erlang .)

Joe Armstrong joe@REDACTED
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:

	integer_to_list([20,4,2,14,16,16], 456789)

would then convert 456789 drams to 
(tons,quarters,hundredweight,stones,pounds,ounces,drams)

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
quantities,

        And negative bases would give complex numbers, etc 


   /Joe

:-)









More information about the erlang-questions mailing list