quote:
Originally posted by Mattike
Now, I'll have to make the negative numbers work... (Smilie) (e.g.: h-A)
That doesn't exists.... That is, if you follow programming logic.
If you follow the math logic they do exist, but be EXTREMELY carefull in what you do, this is far from easy to implement this in the correct way.
Look at how a real scientific calculator works with numbers in another base to get the idea on how to implement it properly...
eg: -128 in hexadecimal can be hFF81, hFFFFFF81, hFFFFFFFFFFFFFF81 etc... convert that back and you could get hFF81 = 65409, hFFFFFF81 = 4294967169, etc. It depends not only on what method you use, but also on the amount of bits/bytes you use to define a hexadecimal/octal/binary number, etc...
My advise would be to not allow negative numbers in other bases than the decimal base.