mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Gabriel Ravier <>
Subject: [musl] Bug report: fcvt seems dysfunctional
Date: Tue, 6 Sep 2022 11:27:15 +0200	[thread overview]
Message-ID: <> (raw)

Executing something like `fcvt(0.01, 1, &decpt, &sign)` under musl 
results in a return value of "00", decpt == 1 and sign == 0.

glibc instead returns an empty string, decpt == -1 and sign == 0.

I believe glibc's behavior is the correct one as mandated by POSIX.2004 
because it specifies that the high-order digit shall be non-zero unless 
the value is 0, which is not the case here, meaning that musl cannot 
return a string containing '0' as the first character.

             reply	other threads:[~2022-09-06  9:27 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-06  9:27 Gabriel Ravier [this message]
2022-09-06 10:12 ` [musl] ecvt(0, 0, ...) is broken Gabriel Ravier
2022-09-06 12:13   ` Joakim Sindholt
2022-09-06 12:21     ` Gabriel Ravier
2022-09-06 14:17       ` Rich Felker
2022-09-06 18:48         ` Markus Wichmann
2022-09-06 19:19           ` Rich Felker
2022-09-07  3:39             ` Markus Wichmann
2022-09-07  3:51               ` Jeffrey Walton
2022-09-07 13:44                 ` Rich Felker

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).