[gnumeric] expmx2h: handle nan explicitly.



commit 23627e6325e57f36006c6e41bea574f52fef6489
Author: Morten Welinder <terra gnome org>
Date:   Sat Jan 2 18:25:02 2016 -0500

    expmx2h: handle nan explicitly.

 ChangeLog      |    2 ++
 src/mathfunc.c |    2 +-
 2 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 8835e30..745fcac 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,7 @@
 2016-01-02  Morten Welinder  <terra gnome org>
 
+       * src/mathfunc.c (expmx2h): Explicitly handle nan, just in case.
+
        * src/go-data-cache.c (go_data_cache_records_set_size): Check for
        zero record size.  Fixes #760087.
 
diff --git a/src/mathfunc.c b/src/mathfunc.c
index cdc22a9..d2d7b6c 100644
--- a/src/mathfunc.c
+++ b/src/mathfunc.c
@@ -4930,7 +4930,7 @@ expmx2h (gnm_float x)
 {
        x = gnm_abs (x);
 
-       if (x < 5)
+       if (x < 5 || gnm_isnan (x))
                return gnm_exp (-0.5 * x * x);
        else if (x >= GNM_MAX_EXP * M_LN2gnum + 10)
                return 0;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]