Convert characters to base 2?

Anirudh Venkataramanan shared this question 4 months ago
Answered

I know that ToBase(Number, Base Number) converts a base 10 number to any base from 2 to 36.


But what about characters? Is there any way to get the base 2 numeric output of 'a' or 'z' in GeoGebra?

Comments (4)

photo
1

use texttounicode("a,b,c,..........................................z") then tobase()

photo
1

Thanks! Do I need two different lines/scripts, or is one enough?


For the character 'a', would I do:


a = TexttoUnicode("a")

ToBase(a, 2)


Or would I have to do something else?

photo
1

Shorter:

ToBase(TexttoUnicode("a"), 2)

photo
1

ParaBase(Elemento(TextoParaUnicode("a"), 1), 2)

photo
© 2019 International GeoGebra Institute