Can someone please help me write a convertor for Hexidecimal to Decimal, has anyone found a way to allow for the entries to be able to be multiplied as integers, even if the input is a character and not a natural number.
Thanks Jack
Can someone please help me write a convertor for Hexidecimal to Decimal, has anyone found a way to allow for the entries to be able to be multiplied as integers, even if the input is a character and not a natural number.
Thanks Jack
....
If the input is a 9 chararcter, then digit to convert is equal to 9.
If the input is a A chararcter, then digit to convert is equal to 10.
If the input is a B chararcter, then digit to convert is equal to 11.
....
PLease, read the followings you can get a conception about the convertion from decimal to binary, octal, hexa and vice-versa.
http://home.iitj.ac.in/~ramana/pds/number_systems.pdf
http://www.cs.ucf.edu/courses/cop3502h.02/binay_octal_Hex.pdf
http://www.math-only-math.com/conversion-of-binary-numbers-to-octal-or-hexa-decimal-numbers.html
http://www.rapidtables.com/math/number/Numeral_system.htm
http://math.stackexchange.com/questions/541253/hexadecimal-to-octal-and-vice-versa
Python function int() will do this for you ...
hx = "FFFF"
# convert hexadecimal string hx to a denary (base 10) number
n = int(hx, 16)
print(n) # 65535
Math with hexadecimal numbers ...
hx1 = "FF"
hx2 = "B7"
product = int(hx1, 16) * int(hx2, 16)
print("{} * {} = {} --> {:X}".format(hx1, hx2, product, product))
'''
FF * B7 = 46665 --> B649
'''
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.