This is the mail archive of the
glibc-bugs@sourceware.org
mailing list for the glibc project.
[Bug libc/23278] New: printf using %a inconsistent
- From: "tydeman.fred at gmail dot com" <sourceware-bugzilla at sourceware dot org>
- To: glibc-bugs at sourceware dot org
- Date: Tue, 12 Jun 2018 16:57:42 +0000
- Subject: [Bug libc/23278] New: printf using %a inconsistent
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=23278
Bug ID: 23278
Summary: printf using %a inconsistent
Product: glibc
Version: 2.27
Status: UNCONFIRMED
Severity: minor
Priority: P2
Component: libc
Assignee: unassigned at sourceware dot org
Reporter: tydeman.fred at gmail dot com
CC: drepper.fsp at gmail dot com
Target Milestone: ---
This code
#include <stdio.h>
int main(void){
(void)printf("%.0a\n", 1.);
(void)printf("%.0a\n", 2.);
(void)printf("%.0a\n", 4.);
(void)printf("%.0a\n", 8.);
(void)printf("%.0a\n", 16.);
(void)printf("%.0a\n", 3.);
(void)printf("%.0a\n", 6.);
(void)printf("%.0a\n", 12.);
(void)printf("%.0a\n", 23.);
(void)printf("%.0a\n", 24.);
(void)printf("%.0a\n", 25.);
return 0;
}
shows that printf uses both 1 bit and 2 bits for the integer part before the
'p'
(which seems inconsistent). My guess is it depends upon rounding up.
--
You are receiving this mail because:
You are on the CC list for the bug.