From 9658746b760cabad602bc6f4297b61da43e189a8 Mon Sep 17 00:00:00 2001 From: Andrew Kirmse Date: Mon, 1 Jul 2024 06:27:47 -0700 Subject: [PATCH] Fix truncation to integer in output filenames. On some systems, abs silently casts to int, causing all outputs to truncate their hundredths values to 0, overwriting each other. --- code/prominence_task.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/prominence_task.cpp b/code/prominence_task.cpp index 5cea4a9..9849ca5 100644 --- a/code/prominence_task.cpp +++ b/code/prominence_task.cpp @@ -134,6 +134,6 @@ string ProminenceTask::getFilenamePrefix() const { } int ProminenceTask::fractionalDegree(double degree) const { - double excess = abs(degree - static_cast(degree)); + double excess = fabs(degree - static_cast(degree)); return static_cast(std::round(100 * excess)); }