From 99ea0a8c19e04c7daf0f2649cd1e4826f64dd722 Mon Sep 17 00:00:00 2001 From: "Christoph M. Wintersteiger" Date: Mon, 30 Mar 2015 08:02:57 +0100 Subject: [PATCH] Bugfix for mpf is_normal. Fixes #17 --- src/util/mpf.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util/mpf.cpp b/src/util/mpf.cpp index d28395195..c96ba594e 100644 --- a/src/util/mpf.cpp +++ b/src/util/mpf.cpp @@ -1350,11 +1350,11 @@ bool mpf_manager::is_ninf(mpf const & x) { } bool mpf_manager::is_normal(mpf const & x) { - return !is_zero(x) && has_bot_exp(x); + return !(has_top_exp(x) || is_denormal(x)); } bool mpf_manager::is_denormal(mpf const & x) { - return has_bot_exp(x); + return !is_zero(x) && has_bot_exp(x); } bool mpf_manager::is_int(mpf const & x) {