Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
printf %a mishandles negative pseudo-precision #15503
Created by firstname.lastname@example.org
$ perl -lwe 'printf "%.*a\n", -1, 1.03125'
The above output is incorrect: it should be "0x1.08p+0". %a is
$ perl -lwe 'printf "%a\n", 1.03125'
The decimal %e, for which precision defaults to 6, handles a negative
$ perl -lwe 'printf "%.*e\n", 1, 1.03125'