Gast
#773265
Hallo Leute! Ich habe da eine Frage: Wie mache ich es am besten, wenn ich einen Fract16-Datentyp als ASCII-Zeichen repräsentieren will? Bsp: fract16 x x = 0x0001 (0.000031) ---> "0.000031" Mfg
|
Anzeige
|
Fract16 auf ASCII
Gast
#773265
Hallo Leute! Ich habe da eine Frage: Wie mache ich es am besten, wenn ich einen Fract16-Datentyp als ASCII-Zeichen repräsentieren will? Bsp: fract16 x x = 0x0001 (0.000031) ---> "0.000031" Mfg
Gast
#774222
fract16 temp = 0x0001;
printf("%.7f\n", (temp&(1<<16)) ? (expr1) : (expr2));
expr1: -(float)temp/(float)32768;
expr2: (float)temp/(float)32768;
Ist aber nicht performant :)
Antwort schreibenBitte melde dich an, um einen Beitrag zu schreiben. |
Anzeige
|