All of lore.kernel.org
 help / color / mirror / Atom feed
From: Rune Torgersen <runet@innovsys.com>
To: u-boot@lists.denx.de
Subject: [U-Boot-Users] printf
Date: Fri, 11 Jul 2003 09:21:55 -0500	[thread overview]
Message-ID: <9F5558593173D21190EA0008C7B176987313E4@innsys1> (raw)

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

             reply	other threads:[~2003-07-11 14:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-11 14:21 Rune Torgersen [this message]
2003-07-11 14:31 ` [U-Boot-Users] printf Wolfgang Denk

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9F5558593173D21190EA0008C7B176987313E4@innsys1 \
    --to=runet@innovsys.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.