public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/114862] New: std::uppercase not applying to nan's and inf's
@ 2024-04-26  7:43 lcarreon at bigpond dot net.au
  2024-04-26  8:47 ` [Bug libstdc++/114862] " redi at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: lcarreon at bigpond dot net.au @ 2024-04-26  7:43 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114862

            Bug ID: 114862
           Summary: std::uppercase not applying to nan's and inf's
           Product: gcc
           Version: 13.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: lcarreon at bigpond dot net.au
  Target Milestone: ---

The following code:

#include <limits>
#include <iostream>
#include <iomanip>

int main()
{
  double values[] =
  {
    std::numeric_limits<double>::quiet_NaN(),
    -std::numeric_limits<double>::quiet_NaN(),
    std::numeric_limits<double>::signaling_NaN(),
    -std::numeric_limits<double>::signaling_NaN(),
    std::numeric_limits<double>::infinity(),
    -std::numeric_limits<double>::infinity()
  };

  for (const auto& value : values)
  {
    std::cout
      << std::uppercase
      << std::fixed << std::setw(17) << std::left << value
      << "  "
      << std::fixed << std::setw(10) << std::left << std::setprecision(0) <<
value
      << "  "
      << std::fixed << std::setw(15) << std::left << std::setprecision(4) <<
value
      << "  "
      << std::fixed << std::setw(17) << std::left << std::setprecision(6) <<
value
      << std::endl;
  }

  return 0;
}

Generates the following output:

nan                nan         nan              nan
-nan               -nan        -nan             -nan
nan                nan         nan              nan
-nan               -nan        -nan             -nan
inf                inf         inf              inf
-inf               -inf        -inf             -inf

Which in my opinion is incorrect because it is not applying std::uppercase.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-04-30 22:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-26  7:43 [Bug libstdc++/114862] New: std::uppercase not applying to nan's and inf's lcarreon at bigpond dot net.au
2024-04-26  8:47 ` [Bug libstdc++/114862] " redi at gcc dot gnu.org
2024-04-26  9:02 ` redi at gcc dot gnu.org
2024-04-26 11:48 ` redi at gcc dot gnu.org
2024-04-30 22:02 ` redi at gcc dot gnu.org

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).