Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use STL functions in parseInt and parseFloat #50

Closed
osrf-migration opened this issue Jul 20, 2016 · 4 comments
Closed

Use STL functions in parseInt and parseFloat #50

osrf-migration opened this issue Jul 20, 2016 · 4 comments
Labels
bug Something isn't working

Comments

@osrf-migration
Copy link

Original report (archived issue) by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


Helpers.hh has functions parseInt and parseFloat that are similar to std::stoi and std::stof. These should use the STL functions where possible.

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


In 3c6f86f, I've modified the existing parse* functions to use the standard library and attempt to match the current behavior for edge cases. There are currently two failed test expectations:

[ RUN      ] HelpersTest.Helpers
src/Helpers_TEST.cc:37: Failure
Value of: math::parseInt("23ab67")
  Actual: 23
Expected: math::NAN_I
Which is: 0
src/Helpers_TEST.cc:54: Failure
Value of: math::isnan(math::parseFloat("23ab67"))
  Actual: false
Expected: true
[  FAILED  ] HelpersTest.Helpers (1 ms)

https://drone.io/bitbucket.org/ignitionrobotics/ign-math/704

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


  • Edited issue description* changed title from "Deprecate parseInt and parseFloat in favor of standard library" to "Use STL functions in parseInt and parseFloat"

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


pull request #224

@osrf-migration
Copy link
Author

Original comment by Steve Peters (Bitbucket: Steven Peters, GitHub: scpeters).


  • changed state from "new" to "resolved"

pull request #224

@osrf-migration osrf-migration added major bug Something isn't working labels Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant