[grisbi-cvs] [SCM] grisbi branch, master, updated. upstream_version_0_9_5-148-g31508ce

Pierre Biava nobody at users.sourceforge.net
Wed Oct 3 23:05:54 CEST 2012


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "grisbi".

The branch, master has been updated
       via  31508ce8961c37705d2f3daff71f5f495189c3d6 (commit)
      from  1b406cfe26d93b018ca5dc0d05bec202de9c0e01 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 31508ce8961c37705d2f3daff71f5f495189c3d6
Author: pbiava <pierre.biava at nerim.net>
Date:   Wed Oct 3 23:04:44 2012 +0200

    Whoops fixed a bug introduced in the comparison of doubles (commit 073f0b2175d1c2bce7cc5a72c59986fad07e62f2)

-----------------------------------------------------------------------

Changes:
diff --git a/src/bet_data_finance.c b/src/bet_data_finance.c
index db2444c..fbf1b37 100644
--- a/src/bet_data_finance.c
+++ b/src/bet_data_finance.c
@@ -58,7 +58,7 @@ gdouble bet_data_finance_get_echeance ( gdouble capital,
     gdouble coeff;
     gdouble number;
 
-    if ( (gint) taux_periodique == 0 )
+    if ( taux_periodique < GSB_EPSILON )
         number = capital / nbre_echeances;
     else
     {
@@ -85,8 +85,8 @@ gdouble bet_data_finance_get_taux_periodique ( gdouble taux, gint type_taux )
 {
     gdouble taux_periodique;
 
-    if ( taux == 0 )
-        return 0;
+    if ( taux < GSB_EPSILON )
+        return 0.;
 
     if ( type_taux )
         taux_periodique = ( taux / 100 ) / 12;
diff --git a/src/structures.h b/src/structures.h
index 6e28231..ea132bb 100644
--- a/src/structures.h
+++ b/src/structures.h
@@ -21,6 +21,7 @@
 #define VERSION_FICHIER_IB "0.6.0"
 
 #define CSV_MAX_TOP_LINES 10	/** How many lines to show in CSV preview.  */
+#define GSB_EPSILON 0.0000005   /* Sert à comparer des doubles */
 
 /** structure etat
  * variables contenant juste 0 ou 1


hooks/post-receive
-- 
grisbi


More information about the cvs mailing list