Skip to content

<iostream>: Wrong reading of float values #3980

Description

@Fedr

Describe the bug

"1e-07" is read from std::istream as 1e-06

Command-line test case

#include <iostream>
#include <sstream>
using namespace std;

int main()
{
    istringstream istr("1e-07");
    double xx = 0;
    istr >> xx;
    cout << "xx = " << xx << endl;
    return 0;
}

STL version

Visual Studio 2022 17.7
Please use Runtime Library not from DLL

Additional context

First found here: https://stackoverflow.com/q/76937234/7325599
This is also DevCom-10450662 / VSO-1876474 / AB#1876474

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfixedSomething works now, yay!high priorityImportant!

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions