-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patha.cpp
More file actions
36 lines (32 loc) · 697 Bytes
/
a.cpp
File metadata and controls
36 lines (32 loc) · 697 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright Glen Knowles 2023.
// Distributed under the Boost Software License, Version 1.0.
//
// a.cpp - bugs msvc2022-2
//
// Compile with: Visual C++ 2022 Version 17.7.4
#include <sstream>
#include <stdio.h>
using namespace std;
int main() {
stringstream io;
float x = 0;
for (auto&& val : initializer_list{ "1e-3", "1e-03", "1e-6", "1e-06" }) {
io.clear();
io.str(val);
io >> x;
printf("%f\n", x);
}
return 0;
}
/////////////////////////////////////////////////////////////////////////////
// Actual output:
// 0.001000
// 0.010000
// 0.000001
// 0.000010
//
// Expected output:
// 0.001000
// 0.001000
// 0.000001
// 0.000001