Skip to content

Treat INF as std::numeric_limits<double>::infinity() in Double#1738

Merged
HansRobo merged 6 commits intomasterfrom
fix/double-INF
Dec 3, 2025
Merged

Treat INF as std::numeric_limits<double>::infinity() in Double#1738
HansRobo merged 6 commits intomasterfrom
fix/double-INF

Conversation

@HansRobo
Copy link
Copy Markdown
Member

@HansRobo HansRobo commented Nov 12, 2025

Description

Abstract

Previously, INF is parsed as std::numeric_limits<double>::max() in openscenario_interpreter::Double.
But in this pull-request, I treat INF as std::numeric_limits<double>::infinity().

Background

In some use cases, I want to check if the value parsed by openscenario_interpreter::Double is inifinity using std::isinf.

Details

a bug fix to read -INF as positive infinity

Due to a mistake in the regular expression, there was a bug where -INF was interpreted as positive infinity.
This bug was discovered while adding unit tests, and the tests warranted a fix.

References

Regression Test: OK

Destructive Changes

The parsed result of INF in scenarios are changed.
From a comparative perspective, there is no difference.

Known Limitations

None

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Nov 12, 2025

Checklist for reviewers ☑️

All references to "You" in the following text refer to the code reviewer.

  • Is this pull request written in a way that is easy to read from a third-party perspective?
  • Is there sufficient information (background, purpose, specification, algorithm description, list of disruptive changes, and migration guide) in the description of this pull request?
  • If this pull request contains a destructive change, does this pull request contain the migration guide?
  • Labels of this pull request are valid?
  • All unit tests/integration tests are included in this pull request? If you think adding test cases is unnecessary, please describe why and cross out this line.
  • The documentation for this pull request is enough? If you think adding documents for this pull request is unnecessary, please describe why and cross out this line.

@HansRobo HansRobo added wait for regression test bump patch If this pull request merged, bump patch version of the scenario_simulator_v2 and removed wait for regression test labels Nov 12, 2025
@HansRobo HansRobo marked this pull request as ready for review November 13, 2025 10:12
@HansRobo HansRobo added bump major If this pull request merged, bump major version of the scenario_simulator_v2 and removed bump patch If this pull request merged, bump patch version of the scenario_simulator_v2 labels Dec 2, 2025
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Dec 2, 2025

Failure optional scenarios

Note

This is an experimental check and does not block merging the pull-request.
But, please be aware that this may indicate a regression.

scenario failed: execution_time_test
      <failure type="SimulationFailure" message="CustomCommandAction typed &quot;exitFailure&quot; was triggered by the named Conditions {&quot;update time checker&quot;, &quot;avoid startup&quot;}: {&quot;update time checker&quot;: Is the /simulation/interpreter/execution_time/update (= 0.014538999999999999840349929059) is greaterThan 0.005?}, {&quot;avoid startup&quot;: Is the simulation time (= 10.150000000000009237055564881302) is greaterThan 1.000000000000000000000000000000?}" />

@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented Dec 2, 2025

@HansRobo HansRobo merged commit e98839f into master Dec 3, 2025
18 of 19 checks passed
@HansRobo HansRobo deleted the fix/double-INF branch December 3, 2025 02:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bump major If this pull request merged, bump major version of the scenario_simulator_v2

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants