Re: Implementation of fixed width floating-point types

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> On 4 Jan 2025, at 13:27, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote:
> 
> 
> 
> On Sat, 4 Jan 2025, 09:48 Hans Åberg, <haberg_1@xxxxxxxxxx> wrote:
> 
> > On 30 Dec 2024, at 16:11, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote:
> > 
> >> On Mon, 30 Dec 2024, 14:28 Hans Åberg, <haberg_1@xxxxxxxxxx> wrote:
> >> 
> >>> On 30 Dec 2024, at 14:24, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote:
> >>> 
> >>> On Sun, 29 Dec 2024 at 14:57, Hans Åberg <haberg_1@xxxxxxxxxx> wrote:
> >>>> 
> >>>> 
> >>>>> On 29 Dec 2024, at 15:16, Jonathan Wakely <jwakely.gcc@xxxxxxxxx> wrote:
> >>>>> 
> >>>>> On Sun, 29 Dec 2024 at 10:01, Hans Åberg via Gcc-help
> >>>>> <gcc-help@xxxxxxxxxxx> wrote:
> >>>>>> 
> >>>>>> When checking the GCC 14.2 implementation of C++23 fixed width floating-point types in the header <stdfloat> [1]:
> >>>>>> 
> >>>>>> The page [2] says that one should be able to write std::float128_t using std::formatter as it is using std::to_chars which is required to support all arithmetic type, but it does not work with GCC.
> >>>>> 
> >>>>> It works fine for me.
> >>>>> 
> >>>>>> But the wording suggests it has been working with GCC.
> >>>>> 
> >>>>> And still is working.
> >>>>> 
> >>>>> If it's not working for you, it must be a limitation of your OS, which
> >>>>> you haven't told us.
> >>>> 
> >>>> It is MacOS 15.2, Silicon, but I think the error is the same on Intel, with
> >>>> % g++ --version
> >>>> g++ (MacPorts gcc14 14.2.0_3+stdlib_flag) 14.2.0
> >>> 
> >>> That's the problem then. std::to_chars is only defined for float128
> >>> under these conditions:
> >>> 
> >>> #if defined(__STDCPP_FLOAT128_T__) &&
> >>> defined(_GLIBCXX_LDOUBLE_IS_IEEE_BINARY128)
> >>> ...
> >>> #elif defined(__STDCPP_FLOAT128_T__) && defined(_GLIBCXX_HAVE_FLOAT128_MATH)
> >>> ...
> >>> #endif
> >>> 
> >>> The HAVE_FLOAT128_MATH macro is currently only defined for Glibc 2.26
> >>> and later, on targets that support __float128.
> 
> The C++ features are not implemented for some reason, as one can use the GNU <quadmath.h> library and adding to g++ the library option -lquadmath, as in this example:
> https://stackoverflow.com/questions/5451447/quadruple-precision-in-c-gcc
> 
> That has nothing to do with std::to_chars or std::format.

Could they not be implemented on top of that?






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux