diff options
author | FormerLurker <hochgebe@gmail.com> | 2020-05-10 19:37:34 +0300 |
---|---|---|
committer | FormerLurker <hochgebe@gmail.com> | 2020-05-10 19:37:34 +0300 |
commit | 4a1f1d55ff5e685a9f2818da7bf3f5e6bf0394d6 (patch) | |
tree | 6651c47d87298138aad30b28212c91d948fc5a92 /GcodeProcessorLib/utilities.cpp | |
parent | 7be8bb7021bfe8e2ea79f572e798e17494253a5c (diff) |
Replace math.h with cmath. Add settings and copyright to gcode output. Add line break to console progress output.
Diffstat (limited to 'GcodeProcessorLib/utilities.cpp')
-rw-r--r-- | GcodeProcessorLib/utilities.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/GcodeProcessorLib/utilities.cpp b/GcodeProcessorLib/utilities.cpp index 5a2c1d6..8844922 100644 --- a/GcodeProcessorLib/utilities.cpp +++ b/GcodeProcessorLib/utilities.cpp @@ -20,7 +20,7 @@ // FormerLurker@pm.me //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// #include "utilities.h" -#include <math.h> +#include <cmath> #include <sstream> #include <iostream> @@ -30,7 +30,7 @@ const std::string utilities::WHITESPACE_ = " \n\r\t\f\v"; bool utilities::is_zero(double x) { - return abs(x) < ZERO_TOLERANCE; + return std::abs(x) < ZERO_TOLERANCE; } int utilities::round_up_to_int(double x) @@ -40,7 +40,7 @@ int utilities::round_up_to_int(double x) bool utilities::is_equal(double x, double y) { - double abs_difference = abs(x - y); + double abs_difference = std::abs(x - y); return abs_difference < ZERO_TOLERANCE; } @@ -67,12 +67,12 @@ bool utilities::less_than_or_equal(double x, double y) // custom tolerance functions bool utilities::is_zero(double x, double tolerance) { - return abs(x) < tolerance; + return std::abs(x) < tolerance; } bool utilities::is_equal(double x, double y, double tolerance) { - double abs_difference = abs(x - y); + double abs_difference = std::abs(x - y); return abs_difference < tolerance; } |