qecvt(3)

✨ qecvt β€” convert a floating-point number to a string ✨

okay bestie, pull up a chair 🫢 this one's from the Library Functions Manual section 3 of the manual, and it is lowkey a fossil. but we're gonna learn it anyway because i love you πŸ’–


πŸ¦‹ NAME πŸ¦‹

qecvt, qfcvt, qgcvt β€” convert a floating-point number to a string

πŸ“š LIBRARY πŸ“š

Standard C library (libc, -lc)

🌸 SYNOPSIS 🌸

#include <stdlib.h>

[[deprecated]] char *qecvt(long double number, int ndigits,
                           int *restrict decpt, int *restrict sign);
[[deprecated]] char *qfcvt(long double number, int ndigits,
                           int *restrict decpt, int *restrict sign);
[[deprecated]] char *qgcvt(long double number, int ndigit, char *buf);

πŸŽ€ Feature Test Macro Requirements for glibc πŸŽ€

(if you don't know what a feature test macro is, go read feature_test_macros(7), it's giving ✨required reading✨)

  • qecvt(), qfcvt(), qgcvt():
    • Since glibc 2.19:
      • _DEFAULT_SOURCE
    • In glibc up to and including 2.19:
      • _SVID_SOURCE
bestie. all three of these are [[deprecated]]. that's in the synopsis, not me being dramatic. πŸ’€

πŸ’… DESCRIPTION πŸ’…

okay so here's the tea, and it's honestly so simple it's almost funny:

The functions qecvt(), qfcvt(), and qgcvt() are identical to ecvt(3), fcvt(3), and gcvt(3) respectively, except that they use a long double argument number. 😌

That's it. That's the whole plot. The q is just the "long double era" version of the same trio. Go see ecvt(3) and gcvt(3) for the actual vibes of what they do.


🧚 ATTRIBUTES 🧚

For an explanation of the terms used in this section, see attributes(7). (iykyk 🌈)

  • qecvt() β€” Thread safety: MT-Unsafe race:qecvt
  • qfcvt() β€” Thread safety: MT-Unsafe race:qfcvt
  • qgcvt() β€” Thread safety: MT-Safe
not qecvt() and qfcvt() being unsafe in a race while qgcvt() is out here being the well-behaved one 😭 slay i guess, qgcvt().

πŸ‘‘ STANDARDS πŸ‘‘

None.

like. none. the standards committee said "who?" πŸ™ˆ


πŸ’€ HISTORY πŸ’€

SVr4, SunOS, GNU.

These functions are obsolete. Instead, snprintf(3) is recommended.

periodt. πŸ’… if you were about to use these in new code: don't, bestie. use snprintf(3). i'm literally begging πŸ₯Ί

πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page!! you absolutely ate that read, no cap πŸŽ€ this was Linux man-pages 6.20, dated 2026-02-08, and it lives on your system as qecvt(3). go forth and use snprintf(3) instead, mwah πŸ’–πŸ¦‹βœ¨

πŸ“¦ where this page comes from
  • arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
  • nixpkgs unstable: man-pages 6.20
  • πŸ“œ the page's license: Linux-man-pages-copyleft
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms