Skip to content

Commit

Permalink
[cli] Dump: abs → std::abs
Browse files Browse the repository at this point in the history
abs(3) takes an int, while std::abs is overloaded
for float, double, ...
Clang will actually warn us about this.
  • Loading branch information
gicmo committed Nov 27, 2015
1 parent 729ff83 commit 25caf67
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cli/modules/Dump.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ class plot_script {

// round min & max to precision of two digits beyond magnitude of their difference,
// if their difference is < 2. Round them to ints otherwise.
double multiplier = abs( round(1 / (maxval - minval)) ) * 100;
double multiplier = std::abs(round(1 / (maxval - minval))) * 100;
minval = (multiplier != 0) ? round(minval * multiplier) / multiplier : round(minval);
maxval = (multiplier != 0) ? round(maxval * multiplier) / multiplier : round(maxval);
str_script.replace(str_script.find("MINVAL"), std::string("MINVAL").length(), nix::util::numToStr(minval));
Expand Down

0 comments on commit 25caf67

Please sign in to comment.