
Hi
Does anybody know how to get printf (for 82xx CPU) to priont floting point numbers? I have tried %f %e and %g but all it prints on the console is f e and g...
I am using a workaround for now, by printing the number as two integers...
float_num = some_float_operation; i = (int)float_num; r = ((int)float_num - i) * 100;
printf("%d.%d", i, r);
But this is kind of bothersome for the long run.
I need this to print out the measured voltages in the system. (done by a supervisor circuit). And yes... The 8266 CPU (actually all the 82xx) has a working FPU unit.
Rune Torgersen System Developer Innovative Systems LLC 1000 Innovative Drive Mitchell, SD 57301 Ph: 605-995-6120 www.innovsys.com

In message 9F5558593173D21190EA0008C7B176987313E4@innsys1 you wrote:
Does anybody know how to get printf (for 82xx CPU) to priont floting point numbers?
U-Boot does not support floating point.
I am using a workaround for now, by printing the number as two integers...
Good idea ;-)
I need this to print out the measured voltages in the system. (done by a supervisor circuit).
You do not need this. See the existing code (like post/sysmon.c).
And yes... The 8266 CPU (actually all the 82xx) has a working FPU unit.
But U-Boot does not use the FPU.
Best regards,
Wolfgang Denk
participants (2)
-
Rune Torgersen
-
Wolfgang Denk