Hi,
ich habe eine 2 Byte Hex Zahl (z.B. 0xA432) und möcht diese in eine floating point zahl umrechnen . Hat da jemand die rechenvorschrift parat?
vielen Dank
gruß
Stefan
Druckbare Version
Hi,
ich habe eine 2 Byte Hex Zahl (z.B. 0xA432) und möcht diese in eine floating point zahl umrechnen . Hat da jemand die rechenvorschrift parat?
vielen Dank
gruß
Stefan
Ich weiß jetzt nicht, wie das beim GCC ist. aber normalerweise schreibt man doch einfach
floatval = (float)shortval;
dann hat C das Problem.
Oder willst du dir das Bit-Gefummel unbedingt antun ?
PicNic: ich glaube er will eine ASCII-Darstellung. Dafür gibts sprintf(). Was du machst ist doch "nur" ein typecast ...
du erstellst ein floatvariable mit wert 0 und sagst dann floatzahl=hexzahl.
mfg pebisoft
@bluebrother: Möglich, daß du recht hast. Vielleicht hat mich "umrechnen" und "Rechenvorschrift" in die Irre geführt