Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Long double support #1597

Open
martinlicht opened this issue Jan 20, 2024 · 0 comments
Open

Long double support #1597

martinlicht opened this issue Jan 20, 2024 · 0 comments

Comments

@martinlicht
Copy link

martinlicht commented Jan 20, 2024

Citing from the in source documentation:

This is a full sprintf replacement that supports everything that
the C runtime sprintfs support, including float/double, 64-bit integers,
hex floats, field parameters (%*.*d stuff), length reads backs, etc.

This should include formatted output of long double, which is part of the C standard (at least the current one) usually indicated by the length specififer L. For example, %Le. However, the allowed length do not include L:

// allowed types:  sc uidBboXx p AaGgEef n
// lengths      :  hh h ll j z t I64 I32 I

The C99 working draft defines printf with support for such floating-point numbers, see also 7.19.6:
http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf
However, I don't know whether that feature was present in C pre-C99.

Another possibly relevant SO thread, regarding MSVC:
https://stackoverflow.com/questions/4089174/printf-and-long-double

I am wondering whether that is a conscious omission or any support for long double is planned, or whether it is practically feasible at all.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant