binary function

Treating binary and g-adic numbers