Austin Group Defect Tracker

Aardvark Mark IV


Viewing Issue Simple Details Jump to Notes ] Issue History ] Print ]
ID Category Severity Type Date Submitted Last Update
0001476 [Issue 8 drafts] Shell and Utilities Editorial Error 2021-05-19 12:21 2021-07-02 12:18
Reporter kre View Status public  
Assigned To
Priority normal Resolution Accepted As Marked  
Status Applied   Product Version Draft 2
Name Robert Elz
Organization
User Reference
Section XCU 2.14 / printf
Page Number 3086
Line Number 104321
Final Accepted Text Note: 0005390
Summary 0001476: Missing '+' character in the second example explanation
Description printf(1) contains an example

    printf "%d\n" 3 +3 -3 \'3 \"+3 "'-3"

which for the first two lines output, is stated to produce

    3 Numeric value of constant 3
    3 Numeric value of constant 3

The second of those should be

    3 Numeric value of constant +3

to match the command line given.
Desired Action In line 104321 on page 3086 (XCU 2.14, printf, EXAMPLES)
(in issue 8, draft 2) change:

Numeric value of constant 3


to:

Numeric value of constant +3



As an optional extra (not a bug) it might be worth adding one more
constant to the command line (or two) and showing the output from
it (or them) as well, where the added command line arg(s) would be
hex &/or octal representations (0x1C or 0254 or whatever you like).
Tags issue8
Attached Files

- Relationships

-  Notes
(0005388)
geoffclare (manager)
2021-06-21 09:26
edited on: 2021-06-21 09:27

Suggested changes...

After line 104302 on page 3085 (XCU 2.14, printf, EXAMPLES), add:
The command:
printf '%d\n' 10 010 0x10
produces:
10
8
16

If the implementation supports floating-point conversions, the command:
printf '%.2f\n' 10 010 0x10 10.1e2 010.1e2 0x10.1p2
produces:
10.00
10.00
16.00
1010.00
1010.00
64.25

In line 104321 on page 3086 (XCU 2.14, printf, EXAMPLES), change:
Numeric value of constant 3
to:
Numeric value of constant +3


(0005390)
geoffclare (manager)
2021-06-24 16:17
edited on: 2021-06-24 16:26

After line 104302 on page 3085 (XCU 2.14, printf, EXAMPLES), add:
The command:
printf '%d\n' 10 010 0x10
produces:
<table>
<tr><th>Output Line</th><th>Explanation</th></tr>
<tr><td><tt>10</tt></td><td>Decimal representation of the numeric value of decimal integer constant 10</td></tr>
<tr><td><tt>8</tt></td><td>Decimal representation of the numeric value of octal integer constant 010</td></tr>
<tr><td><tt>16</tt></td><td>Decimal representation of the numeric value of hexadecimal integer constant 0x10</td></tr>
</table>

If the implementation supports floating-point conversions, the command:
LC_ALL=C printf '%.2f\n' 10 010 0x10 10.1e2 010.1e2 0x10.1p2
produces:
<table>
<tr><th>Output Line</th><th>Explanation</th></tr>
<tr><td><tt>10.00</tt></td><td>The string "10" interpreted as a decimal value, with 2 digits of precision.</td></tr>
<tr><td><tt>10.00</tt></td><td>The string "010" interpreted as a decimal (not octal) value, with 2 digits of precision.</td></tr>
<tr><td><tt>16.00</tt></td><td>The string "0x10" interpreted as a hexadecimal value, with 2 digits of precision.</td></tr>
<tr><td><tt>1010.00</tt></td><td>The string "10.1e2" interpreted as a decimal floating-point value, with 2 digits of precision.</td></tr>
<tr><td><tt>1010.00</tt></td><td>The string "010.1e2" interpreted as a decimal (not octal) floating-point value, with 2 digits of precision.</td></tr>
<tr><td><tt>64.25</tt></td><td>The string "0x10.1p2" interpreted as a hexadecimal floating-point value, with 2 digits of precision.</td></tr>
</table>

On page 3086 replace lines 104317-104325 with:
In a locale that uses a codeset based on ISO/IEC 646: 1991, the command:
printf "%d\n" 3 +3 -3 \'3 \"+3 "'-3"
produces:
<table>
<tr><th>Output Line</th><th>Explanation</th></tr>
<tr><td><tt>3</tt></td><td>Decimal representation of the numeric value 3</td></tr>
<tr><td><tt>3</tt></td><td>Decimal representation of the numeric value +3</td></tr>
<tr><td><tt>-3</tt></td><td>Decimal representation of the numeric value -3</td></tr>
<tr><td><tt>51</tt></td><td>Decimal representation of the numeric value of the character <tt>'3'</tt> in the ISO/IEC 646: 1991 standard codeset</td></tr>
<tr><td><tt>43</tt></td><td>Decimal representation of the numeric value of the character <tt>'+'</tt> in the ISO/IEC 646: 1991 standard codeset</td></tr>
<tr><td><tt>45</tt></td><td>Decimal representation of the numeric value of the character <tt>'-'</tt> in the ISO/IEC 646: 1991 standard codeset</td></tr>
</table>

In the paragraph at line 104326, move the second sentence ("Since the last two ...") to before the first sentence ("Note that in a locale ...").


- Issue History
Date Modified Username Field Change
2021-05-19 12:21 kre New Issue
2021-05-19 12:21 kre Name => Robert Elz
2021-05-19 12:21 kre Section => XCU 2.14 / printf
2021-05-19 12:21 kre Page Number => 3086
2021-05-19 12:21 kre Line Number => 104321
2021-06-21 09:26 geoffclare Note Added: 0005388
2021-06-21 09:27 geoffclare Note Edited: 0005388
2021-06-24 16:17 geoffclare Note Added: 0005390
2021-06-24 16:18 geoffclare Final Accepted Text => Note: 0005390
2021-06-24 16:18 geoffclare Status New => Resolved
2021-06-24 16:18 geoffclare Resolution Open => Accepted As Marked
2021-06-24 16:18 geoffclare Tag Attached: issue8
2021-06-24 16:26 geoffclare Note Edited: 0005390
2021-07-02 12:18 geoffclare Status Resolved => Applied


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker