D the, Printf conver, Sion characters – Zilog Z8F0130 User Manual
Page 478

Appendix B. C Standard Library
UM013037-1212
454
Zilog Developer Studio II – Z8 Encore!
User Manual
printf Conversion Characters
d,i,o,u,x,X
The int argument is converted to signed decimal (d or i), unsigned octal
(o), unsigned decimal (u), or unsigned hexadecimal notation (x or X); the
letters abcdef are used for x conversion and the letters ABCDEF for X
conversion. The precision specifies the minimum number of digits to
appear; if the value being converted can be represented in fewer digits, it
is expanded with leading zeros. The default precision is 1. The result of
converting a zero value with a precision of zero is no characters.
f
The double argument is converted to decimal notation in the style [-
]ddd.ddd, where the number of digits after the decimal point is equal to the
precision specification. If the precision is missing, it is taken as 6; if the
precision is explicitly zero, no decimal point appears. If a decimal point
appears, at least one digit appears before it. The value is rounded to the
appropriate number of digits.
e,E
The double argument is converted in the style [-]d.ddde+dd, where there is
one digit before the decimal point and the number of digits after it is equal
to the precision; when the precision is missing, six digits are produced; if
the precision is zero, no decimal point appears. The value is rounded to
the appropriate number of digits. The E conversion character produces a
number with E instead of e introducing the exponent. The exponent
always contains at least two digits. However, if the magnitude to be
converted is greater than or equal to lE+100, additional exponent digits are
written as necessary.
g,G
The double argument is converted in style f or e (or in style E in the case of
a G conversion character), with the precision specifying the number of
significant digits. The style used depends on the value converted; style e is
used only if the exponent resulting from the conversion is less than -4 or
greater than the precision. Trailing zeros are removed from the result; a
decimal point appears only if it is followed by a digit.
c
The int argument is converted to an unsigned char, and the resulting
character is written.
s
The argument is taken to be a (const char *) pointer to a string. Characters
from the string are written up to, but not including, the terminating null
character, or until the number of characters indicated by the precision are
written. If the precision is missing it is taken to be arbitrarily large, so all
characters before the first null character are written.
p
The argument is taken to be a (const void) pointer to an object. The value
of the pointer is converted to a sequence of hex digits.
n
The argument is taken to be an (int) pointer to an integer into which is
written the number of characters written to the output stream so far by this
call to printf. No argument is converted.
%
A % is written. No argument is converted.
- Z8F0131 Z8F0230 Z8F0231 Z8F0430 Z8F0431 Z8F043A Z8F0830 Z8F0831 Z8F083A Z8F1232 Z8F1233 Z8F0113 Z8F011A Z8F0123 Z8F012A Z8F0213 Z8F021A Z8F0223 Z8F022A Z8F0411 Z8F0412 Z8F0413 Z8F041A Z8F0421 Z8F0422 Z8F0423 Z8F042A Z8F0811 Z8F0812 Z8F0813 Z8F081A Z8F0821 Z8F0822 Z8F0823 Z8F082A Z8F0880 Z8F1621 Z8F1622 Z8F1680 Z8F1681 Z8F1682 Z8F2421 Z8F2422 Z8F2480 Z8F3221 Z8F3222 Z8F3281 Z8F3282 Z8F4821 Z8F4822 Z8F4823 Z8F6081 Z8F6082 Z8F6421 Z8F6422 Z8F6423 Z8F6481 Z8F6482 Z8FS021A ZMOT1AHH Z8FS040B ZMOT0BHH ZMOT0BSB Z8FMC04 Z8FMC08 Z8FMC16