Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

print floating point numbers

21 views
Skip to first unread message

Ivan Kossey

unread,
Apr 3, 2010, 5:24:20 AM4/3/10
to
Hi Gurus!

I printed integers with format string (like "%6d ") without any problem. But
how to print floating point numbers?
I have to print a 4-byte number. What push into stack? Should I push the
address of number? What is with length of number (4, 8 or 10 bytes)?

The format string I use is following:

db "%6.1f ",0

Thanks

Happy Easter!

Tim Roberts

unread,
Apr 4, 2010, 12:39:58 AM4/4/10
to

You should mention that you are calling "printf". That's critically
important to your question.

All of the floating formats in printf require an 8-byte double. If you
have a 4-byte single, you'll need to convert it to a double and push those
8 bytes.
--
Tim Roberts, ti...@probo.com
Providenza & Boekelheide, Inc.

123

unread,
May 4, 2010, 8:32:20 PM5/4/10
to
123
"Ivan Kossey" <fgh...@dfghgfd.de>
??????:%23ZPD09w...@TK2MSFTNGP05.phx.gbl...
0 new messages