Skip to content

Node double assignment and as<double> error. #1380

@aaatthework

Description

@aaatthework

I am setting a node with "1663.1234567891011". After that I am calling it using as. As a result I am getting "0.000450628205" instead of "1663.1234567891011".

Example code is given below.

int main() {
    YAML::Node node;
    double val = 1663.1234567891011;

    node["my_val"] = val;

    std::cout << "Value read:    " << node["my_val"].as<double>() << "\n";

    return 0;
}

Output:

Value read:    0.000450628

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions