[U-Boot-Users] printf

Rune Torgersen runet at innovsys.com
Fri Jul 11 16:21:55 CEST 2003


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




More information about the U-Boot mailing list