From: John Darrington Date: Sat, 11 Jul 2020 09:08:23 +0000 (+0200) Subject: SpreadLevel Plot: Don't try to take the logarithm of a negative X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ac2fba558fc64d7f1a554e9388d5adfe5ad22f0e;p=pspp SpreadLevel Plot: Don't try to take the logarithm of a negative --- diff --git a/src/output/charts/spreadlevel-plot.c b/src/output/charts/spreadlevel-plot.c index 8b599b8cd2..e4fed61786 100644 --- a/src/output/charts/spreadlevel-plot.c +++ b/src/output/charts/spreadlevel-plot.c @@ -1,5 +1,5 @@ /* PSPP - a program for statistical analysis. - Copyright (C) 2012 Free Software Foundation, Inc. + Copyright (C) 2012, 2020 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -53,10 +53,11 @@ spreadlevel_plot_add (struct chart_item *ci, double spread, double level) { struct spreadlevel_plot_chart *sl = to_spreadlevel_plot_chart (ci); + /* Zero has a special meaning, in this implementation. */ if (sl->tx_pwr == 0) { - spread = log (spread); - level = log (level); + spread = log (fabs (spread)); + level = log (fabs (level)); } else {