All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot-Users] printf
@ 2003-07-11 14:21 Rune Torgersen
  2003-07-11 14:31 ` Wolfgang Denk
  0 siblings, 1 reply; 2+ messages in thread
From: Rune Torgersen @ 2003-07-11 14:21 UTC (permalink / raw)
  To: u-boot

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-07-11 14:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-07-11 14:21 [U-Boot-Users] printf Rune Torgersen
2003-07-11 14:31 ` Wolfgang Denk

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.