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

Wrong abs used in TranslationFactor #1920

Open
ProfFan opened this issue Dec 7, 2024 · 1 comment
Open

Wrong abs used in TranslationFactor #1920

ProfFan opened this issue Dec 7, 2024 · 1 comment

Comments

@ProfFan
Copy link
Collaborator

ProfFan commented Dec 7, 2024

/home/fan/src/gtsam/gtsam/sfm/TranslationFactor.h:137:30: warning: using integer absolute value function 'abs' when argument is of floating point type [-Wabsolute-value]
  137 |     const double abs_scale = abs(scale[0]);
      |                              ^
/home/fan/src/gtsam/gtsam/sfm/TranslationFactor.h:137:30: note: use function 'std::abs' instead
  137 |     const double abs_scale = abs(scale[0]);
      |                              ^~~
      |                              std::abs
@varunagrawal
Copy link
Collaborator

Is this a false negative? abs is overloaded and unless we're using the C version, I guess the main thing is to just add the std::

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants