[gnumeric] Rounding cleanup.
- From: Morten Welinder <mortenw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnumeric] Rounding cleanup.
- Date: Thu, 3 Apr 2014 01:12:46 +0000 (UTC)
commit a372ec98e3c58cceaecb50b162e4249dc1b8f195
Author: Morten Welinder <terra gnome org>
Date: Wed Apr 2 21:12:19 2014 -0400
Rounding cleanup.
ChangeLog | 5 +++++
plugins/fn-financial/sc-fin.c | 2 +-
src/sf-gamma.c | 4 ++--
3 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index fd8838f..44f6ae6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2014-04-02 Morten Welinder <terra gnome org>
+
+ * src/sf-gamma.c (pochhammer): Plain floor is good enough for
+ integer test.
+
2014-03-30 Morten Welinder <terra gnome org>
* src/application.c (gnm_app_remove_extra_ui): Remove from global
diff --git a/plugins/fn-financial/sc-fin.c b/plugins/fn-financial/sc-fin.c
index 2953a6e..affbe71 100644
--- a/plugins/fn-financial/sc-fin.c
+++ b/plugins/fn-financial/sc-fin.c
@@ -123,7 +123,7 @@ get_amordegrc (gnm_float fCost, GDate *nDate, GDate *nFirstPer,
gint n;
gnm_float fAmorCoeff, fNRate, fRest, fUsePer;
-#define Round(x,y) (gnm_floor ((x) + 0.5))
+#define Round(x,y) (go_rint (x))
fUsePer = 1.0 / fRate;
diff --git a/src/sf-gamma.c b/src/sf-gamma.c
index a71c2f4..87e8dec 100644
--- a/src/sf-gamma.c
+++ b/src/sf-gamma.c
@@ -744,8 +744,8 @@ pochhammer (gnm_float x, gnm_float n)
if (n == 0)
return 1;
- rx = gnm_floor (x + 0.5);
- rn = gnm_floor (n + 0.5);
+ rx = gnm_floor (x);
+ rn = gnm_floor (n);
/*
* Use naive multiplication when n is a small integer.
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]