public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jvdelisle at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/93727] Fortran 2018: EX edit descriptor
Date: Sun, 10 Mar 2024 17:17:28 +0000 [thread overview]
Message-ID: <bug-93727-4-LzGNJXCQiR@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-93727-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93727
--- Comment #7 from Jerry DeLisle <jvdelisle at gcc dot gnu.org> ---
(In reply to Thomas Henlich from comment #6)
--- snip ---
> Just some thoughts:
>
> Have you tried "%LA" for long double?
>
> Have you tried quadmath_snprintf
> (https://gcc.gnu.org/onlinedocs/libquadmath/quadmath_005fsnprintf.html) with
> "%QA" for quad precision?
That was the hint I needed.
#include <stdio.h>
int main()
{
float x = 1.0f / 3.0f;
double y = 1.0l / 3.0l;
long double z = 1.0L / 3.0L;
printf(" FLOAT: %.18A\n", x);
printf(" DOUBLE: %.18lA\n", y);
printf("LONG DBL: %.18LA\n", z);
printf(" 123456789012345678901234567890\n");
printf(" FLOAT: %.20f\n", x);
printf(" DOUBLE: %.20lf\n", y);
printf("LONG DBL: %.20Lf\n", z);
}
$ gcc hexfloat.c
$ ./a.out
FLOAT: 0X1.555556000000000000P-2
DOUBLE: 0X1.555555555555500000P-2
LONG DBL: 0XA.AAAAAAAAAAAAAAB000P-5
123456789012345678901234567890
FLOAT: 0.33333334326744079590
DOUBLE: 0.33333333333333331483
LONG DBL: 0.33333333333333333334
I will check the libqudmath version as well.
Thanks.
prev parent reply other threads:[~2024-03-10 17:17 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bug-93727-4@http.gcc.gnu.org/bugzilla/>
2020-07-12 15:38 ` dominiq at lps dot ens.fr
2020-07-14 12:51 ` jvdelisle at charter dot net
2020-08-11 14:41 ` dominiq at lps dot ens.fr
2020-08-14 21:34 ` jvdelisle at charter dot net
2020-08-29 18:04 ` jvdelisle at charter dot net
2024-03-06 2:34 ` jvdelisle at gcc dot gnu.org
2024-03-10 3:37 ` jvdelisle at gcc dot gnu.org
2024-03-10 9:41 ` thenlich at gcc dot gnu.org
2024-03-10 17:17 ` jvdelisle at gcc dot gnu.org [this message]
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:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-93727-4-LzGNJXCQiR@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* 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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).