We can insert a number in a basis different than 10 using the basis^^number expression.
However, strangely enough, there does not seem to be a corresponding functional form to do this.
Moreover, to convert a number of inputs to decimal basis, the common syntax
2^^ # & /@ {0, 11, 10, 0}
does not work, and I have to use instead an expression of the form
ToExpression["2^^" <> ToString@#] & /@ {0, 11, 10, 0}
This, however, seems more like a workaround than a solution.
Why does the former syntax not work? And why is there no functional form of the basis^^number short syntax?
BaseFormis the functional form and appears to work withMapin the way you've described above. – IPoiler Jan 12 '16 at 19:21FromDigits[#,2]&:FromDigits[#, 2] & /@ {{0, 0}, {1, 1}, {1, 0}, {0, 0}}gives :{0, 3, 2, 0}? – andre314 Jan 12 '16 at 19:22BaseForm, to my knowledge, only converts from decimal to another basis. How do you make it work the other way around, without using thebase^^numbersyntax? – glS Jan 12 '16 at 19:23BaseForm[#,10]. For example,BaseForm[2^^10,10]gives2. – IPoiler Jan 12 '16 at 19:27FromDigits, but I didn't notice before the possibility of using as inFromDigits["ff",16]. This of course allows to use it withMapwith something like, for example,FromDigits[#,16]&/@{"aa","ff"}, which is way better than usingToExpression. Thanks a lot for the pointer, I'll accept that as an answer if you care to make it such (I still wonder on why exactly is there no functionalFullFormfor thebase^^numbersyntax though) – glS Jan 12 '16 at 19:29BaseForm[#,10]&does nothing at all, as you can easily try. Show me how would you convert a list of binary (or hexadecimal, or whatever else really) numbers to base 10 with theBaseFormnotation and I will be convinced! – glS Jan 12 '16 at 19:32FromDigits). The reverse is notBaseFormbutIntegerDigits.^^ # &does not work because^^is not an operator but part of the number syntax, just like the decimal point is, or*^for the exponent. – Szabolcs Jan 12 '16 at 19:58