Commit 0012f566a for imagemagick.org
commit 0012f566af706682b90dbed7b29833fef0211748
Author: Cristy <urban-warrior@imagemagick.org>
Date: Wed Jun 17 22:05:18 2026 -0400
less branches
diff --git a/MagickCore/statistic-private.h b/MagickCore/statistic-private.h
index af32aa24b..88e395583 100644
--- a/MagickCore/statistic-private.h
+++ b/MagickCore/statistic-private.h
@@ -29,17 +29,13 @@ static inline MagickBooleanType MagickSafeSignificantError(const double error,
return(error > threshold ? MagickTrue : MagickFalse);
}
-#define MagickLogEpsilon 1.0e-30
+#ifndef DBL_TRUE_MIN
+#define DBL_TRUE_MIN 4.9406564584124654e-324
+#endif
static inline double MagickSafeLog10(const double x)
{
- if (x <= 0.0)
- return(log10(MagickLogEpsilon));
- if (x < MagickLogEpsilon)
- return(log10(MagickLogEpsilon));
- if (fabs(x-1.0) < MagickLogEpsilon)
- return(0.0);
- return(log10(x));
+ return(log10(fmax(x,DBL_TRUE_MIN)));
}
static inline double MagickSafeReciprocal(const double x)