[gnumeric] fn-eng: fix conversion problem with --with-long-double
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] fn-eng: fix conversion problem with --with-long-double
- Date: Sun, 6 Feb 2022 18:36:46 +0000 (UTC)
commit 68ef4b4cbf731ba5f8ace0cf0b885751730a3ee6
Author: Morten Welinder <terra gnome org>
Date: Sun Feb 6 13:36:20 2022 -0500
fn-eng: fix conversion problem with --with-long-double
plugins/fn-eng/ChangeLog | 5 +++++
plugins/fn-eng/functions.c | 5 +++--
2 files changed, 8 insertions(+), 2 deletions(-)
---
diff --git a/plugins/fn-eng/ChangeLog b/plugins/fn-eng/ChangeLog
index 257563d91..5e8605fab 100644
--- a/plugins/fn-eng/ChangeLog
+++ b/plugins/fn-eng/ChangeLog
@@ -1,3 +1,8 @@
+2022-02-06 Morten Welinder <terra gnome org>
+
+ * functions.c (val_to_base): Make sure not to pass a long-double
+ format to g_ascii_formatd because it doesn't understand that.
+
2022-01-20 Morten Welinder <terra gnome org>
* Release 1.12.51
diff --git a/plugins/fn-eng/functions.c b/plugins/fn-eng/functions.c
index e307bc817..398e7f47f 100644
--- a/plugins/fn-eng/functions.c
+++ b/plugins/fn-eng/functions.c
@@ -144,9 +144,10 @@ val_to_base (GnmFuncEvalInfo *ei,
if (val < min_value || val > max_value)
return value_new_error_NUM (ei->pos);
+ // For long-double we need a better replacement for this
g_ascii_formatd (buf, sizeof (buf) - 1,
- "%.0" GNM_FORMAT_f,
- val);
+ "%.0f",
+ (double)val);
v = g_ascii_strtoll (buf, &err, src_base);
if (*err != 0)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]