From 929cfb96fa59a37eaadc5499764f5f51e9d34509 Mon Sep 17 00:00:00 2001 From: "Joachim Wuttke (l)" <j.wuttke@fz-juelich.de> Date: Mon, 7 Aug 2017 12:40:27 +0200 Subject: [PATCH] exclude nan and inf from computing plot limits --- pub/CHANGELOG | 4 ++-- pub/lib/plot.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pub/CHANGELOG b/pub/CHANGELOG index bc6ee9e6..4aecd55e 100644 --- a/pub/CHANGELOG +++ b/pub/CHANGELOG @@ -7,10 +7,10 @@ Release 2.4.0b of 21apr17: - Modified functionality: - - sqrt, ln, lg return NaN outside their definition range + - sqrt, ln, lg return +-inf or nan outside their definition range - sqrt0, ln0, lg0 return 0 outside the definition range of the standard functions - Bug fix: - - detection of dy==0 for fit weighing was inverted + - correct inverted boolean dy==0 in fit weight mechanism Release 2.4.0a of 24mar17: diff --git a/pub/lib/plot.cpp b/pub/lib/plot.cpp index bbd42fe7..51f13430 100644 --- a/pub/lib/plot.cpp +++ b/pub/lib/plot.cpp @@ -111,7 +111,7 @@ namespace { for (int i = 0; i < s->size(); i++) { if (!plot->X.contains(s->x[i])) continue; - if (plot->Y.logflag && s->y[i] <= 0) + if (!std::isfinite(s->y[i]) || plot->Y.logflag && s->y[i] <= 0) continue; if (s->y[i] < inf) inf = s->y[i]; -- GitLab