Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Tue, 6 Sep 2022 23:13:26 +0200
From: Gabriel Ravier <>
Subject: fcvt(99.99, 1, ...) appears to be broken because of varying rounding

fcvt(99.99, 1, &decpt, &sign) results in musl returning "9999". I am 
pretty sure the standard ensures that regardless of how the rounding is 
done, only "999" and "1000" are supposed to be valid results for fcvt in 
this situation.

I'd like to add that this seems to occur because of a difference in 
rounding that occurs between the calls to sprintf in fcvt and ecvt, with 
fcvt's call of it returning "100.0" and ecvt's call returning 
"9.999e+01" (i.e. fcvt asked ecvt for 4 significant digits assuming it 
would return "1000" but it ended up getting a contradicting result from 
its call to printf)

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.