broadcast address and erlang:'bnot'/1

Bengt Kleberg bengt.kleberg@REDACTED
Tue Nov 22 09:44:39 CET 2005


greetings,

i am creating broadcast addresses. is there such a function in an erlang 
module? my current solution is:

broadcast_address( Address, Mask ) ->
	Fun = fun ( Int ) -> 255 bxor Int end,
	Inverted = lists:map( Fun, Mask ),
	lists:zipwith( fun erlang:'bor'/2, Address, Inverted ).

is there a better way?


if somebody asks me about where the bit operators/functions are 
documented, where should i tell them to look? it is not in the erlang 
module (or have i just missed them). there is no ''bnot'' in the 
permuted index (actually there is not even a ''bif'' in the permuted 
index). ''bnot'' seems to operate on signed integers. i would like to 
invert an unsigned char.


bengt



More information about the erlang-questions mailing list