I'm trying to do a large number of computations where we want to
- take the output of BaseForm converting Hexadecimal values to Decimal
- show the intermediate result of a computation in Decimal
- convert the intermediate result from [2] back to Hexadecimal using BaseForm
I am able to generate a prototype of the desired result Manually Using The First[] Function but this is not the desired method as this requires the annoying step of having to know that the first item in the list which makes up the BaseForm[] return type is the value I want to convert.
Print["Here's the decimal value ", dec = BaseForm[16^^FFFFD188,10]]
Print["What type is the return from BaseForm? It is this --> ", Head[dec]]
Print["This manual step Head[First[dec]]] gives me an integer type ", Head[First[dec]]]
Print["And now we can show the result of the desired calculation in decimal ", desiredCalculation = First[dec]-3072000]
Print["Now show the result back in Hex ",BaseForm[desiredCalculation,16]]
Print["It would be nice if Mathematica could detect what do do in the first place..... dec2 = BaseForm[16^^FFFFD188,10]-400....but it can't -->", dec2 = BaseForm[16^^FFFFD188,10]-400]
Here's the decimal value 4294955400
What type is the return from BaseForm? It is this --> BaseForm
This manual step Head[First[dec]]] gives me an integer type Integer
And now we can show the result of the desired calculation in decimal 4291883400
Now show the result back in Hex Subscript[ffd0f188, 16]
It would be nice if Mathematica could detect what do do in the first place..... dec2 = BaseForm[16^^FFFFD188,10]-400....but it can't -->-400+4294955400