Question: How do I convert a list of decimal integers to a list of binary numbers ?

I have a list of single digit integers

mylist:=[1,2,3];

and it is easy to use

for x in mylist do convert(mylist[x],binary) end do;

to obtain 1, 10, 11 as the result.

However if

mylist:=[1,2,25];

two values are converted sucessfully but the third produces "Error, invalid subscript selector"

whattype(mylist) gives "list"

whattype(mylist[3]); gives "integer"

 

 

 

 

 

Please Wait...