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

            Bug ID: 110749
           Summary: wrong show float
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: alexsyrezerv at mail dot ru
  Target Milestone: ---

Created attachment 55586
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55586&action=edit
To try on different compillers

Code:
```
#include <iostream>
#include <iomanip>

void func_float_point(std::ostream& os, const double& value, const std::size_t&
size) {
  os << (0.0 > value ? '-' : '0') << std::setw(size - 1) << std::setfill('0')
<< std::abs(value);
}

int main(int, char**) {
  const double a[] = {90.8425, 101.9225};
  for(std::size_t i = 0; i < 2; ++i){
    func_float_point(std::cout, a[i], 17);
    std::cout << std::endl;
  }

  return 0;
}
```
result
```
butiaev@butiaev-VirtualBox:~/tmp$ make bug
g++     bug.cpp   -o bug
butiaev@butiaev-VirtualBox:~/tmp$ ./bug
000000000090.8425
0000000000101.922
butiaev@butiaev-VirtualBox:~/tmp$

```

Reply via email to