A-80
Motorola DSP56000 Family Optimizing C Compiler User’s Manual
For More Information On This Product,
Go to: www.freescale.com
Motorola
There are 16 conversion characters; each is described in Table A-7.
Table A-8. Conversion Characters
Conversion Character
Description
d, i
The int argument is printed as a signed decimal number. The precision specifies
the minimum number of digits to appear; if the value being printed can be
represented in fewer digits, it is expanded with leading zeros. The default precision
is 1. The result of printing a zero with precision zero is no characters (this is
independent of padding specified by field width).
o
The
unsigned int
argument is printed as an unsigned octal number. When
used in association with the
#
flag, 0 will be prefixed to non-zero results. The
precision
specifies the minimum number of digits to appear; if the value can be
represented in fewer digits, it will be expanded with leading zeros. The default
precision
is 1. The result of printing a zero with
precision
zero is no characters
(this is independent of padding specified by
field width
).
u
The
unsigned int
argument is printed as an unsigned decimal number. The
precision
specifies the minimum number of digits to appear; if the value can be
represented in fewer digits, it will be expanded with leading zeros. The default
precision
is 1. The result of printing a zero with
precision
zero is no characters
(this is independent of padding specified by
field width
).
x, X
The
unsigned int
argument is printed as an unsigned hexadecimal
number. Hexadecimal alpha characters (a,b,c,d,e,f) will be printed in lower case
when
x
is used and in upper case when
X
is used. When used in association with
the
#
flag, 0x will be prefixed to the result (0X in the
X
case).
Precision
specifies
the minimum number of digits to appear; if the value can be represented in fewer
digits, it will be expanded with leading zeros. The default
precision
is 1. The result
of printing a zero with
precision
zero is no characters (this is independent of
padding specified by
field width
).
f
The
double
argument is printed out in decimal notation of the form [
-
]ddd.ddd,
where
precision
specifies the number of digits to follow the decimal point. The
default
precision
6. When
precision
is 0 and the
#
flag is not specified, no decimal
point character will be printed. A decimal digit will always follow at least one digit.
The value printed is rounded to the appropriate number of digits.
e, E
The
double
argument is printed out in the form [
-
] d.ddd
e
±dd, where
precision
specifies the number of digits to follow the decimal point. The default
precision 6
.
When
precision
is 0 and the
#
flag is not specified, no decimal point character will
be printed. A decimal digit will always follow at least one digit. The exponent
always contains at least two digits.
g, G
The
double
argument is printed in the
f
,
e
, or
E
form. The
f
form is used unless
the exponent to be printed is less than
-4
or greater than the
precision
. If precision
is zero, the printed value consists of no characters (this is independent of padding
specified by
field width
). Trailing zeros are removed from the fractional portion of
the result; a decimal point character is printed only if it is followed by a digit.
c
The
int
argument is printed as an unsigned character.
F
Freescale Semiconductor, Inc.
n
.