Matlab hex2dec function not converting hex into dec accurately.

1 vue (au cours des 30 derniers jours)
sidra rahim
sidra rahim le 2 Fév 2019
Commenté : sidra rahim le 3 Fév 2019
I am trying to convert Hex: C3B829A1E8642B78 in matlab using hex2dec but it is not giving me the correct result. I know the problem is of precision, The answer should have been 14103068008476060536 but matlab is giving 14103068008476060000. I want it to be accurate as I have to use the result for further calculations. Please help.

Réponse acceptée

Walter Roberson
Walter Roberson le 3 Fév 2019
use sscanf eith %lx format for unsigned 64 bit hex.

Plus de réponses (1)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by