[grisbi-cvs] grisbi/src gsb_real.h,1.23,1.23.2.1
Gunee
guneemwelloeux at users.sourceforge.net
Tue Dec 1 13:13:24 CET 2009
- Next message: [grisbi-cvs] grisbi/src accueil.c, 1.218, 1.218.2.1 balance_estimate_tab.c, 1.23, 1.23.2.1 etats_affiche.c, 1.108, 1.108.2.1 etats_calculs.c, 1.133, 1.133.2.1 export_csv.c, 1.25, 1.25.2.1 file_obfuscate.c, 1.12, 1.12.2.1 gsb_account.c, 1.47, 1.47.2.1 gsb_account_property.c, 1.48, 1.48.2.1 gsb_autofunc.c, 1.24, 1.24.2.1 gsb_currency.c, 1.54, 1.54.2.1 gsb_currency_link_config.c, 1.18, 1.18.2.1 gsb_data_account.c, 1.91, 1.91.2.1 gsb_data_archive_store.c, 1.16, 1.16.2.1 gsb_data_budget.c, 1.54, 1.54.2.1 gsb_data_category.c, 1.71, 1.71.2.1 gsb_data_currency_link.c, 1.17, 1.17.2.1 gsb_data_partial_balance.c, 1.10, 1.10.2.1 gsb_data_payee.c, 1.50, 1.50.2.1 gsb_data_reconcile.c, 1.20, 1.20.2.1 gsb_data_report_amout_comparison.c, 1.14, 1.14.2.1 gsb_data_scheduled.c, 1.30, 1.30.2.1 gsb_data_transaction.c, 1.76, 1.76.2.1 gsb_debug.c, 1.14, 1.14.2.1 gsb_file_load.c, 1.192, 1.192.2.1 gsb_file_save.c, 1.143, 1.143.2.1 gsb_form.c, 1.137, 1.137.2.1 gsb_form_transaction.c, 1.51, 1.51.2.1 gsb_real.c, 1.59, 1.59.2.1 gsb_reconcile.c, 1.42, 1.42.2.1 gsb_rec oncile_config.c, 1.30, 1.30.2.1 gsb_reconcile_list.c, 1.10, 1.10.2.1 gsb_scheduler_list.c, 1.74, 1.74.2.1 gsb_transactions_list.c, 1.189, 1.189.2.1 gsb_transactions_list_sort.c, 1.21, 1.21.2.1 import.c, 1.308, 1.308.2.1 meta_budgetary.c, 1.37, 1.37.2.1 meta_categories.c, 1.48, 1.48.2.1 meta_payee.c, 1.35, 1.35.2.1 transaction_list.c, 1.52, 1.52.2.1 utils_editables.c, 1.32, 1.32.2.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/grisbi/grisbi/src
In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv13395
Modified Files:
Tag: version_0_6_0-new_gsb_real
gsb_real.h
Log Message:
with new gsb_real type
Index: gsb_real.h
===================================================================
RCS file: /cvsroot/grisbi/grisbi/src/gsb_real.h,v
retrieving revision 1.23
retrieving revision 1.23.2.1
diff -u -d -r1.23 -r1.23.2.1
--- gsb_real.h 13 Nov 2009 19:42:02 -0000 1.23
+++ gsb_real.h 1 Dec 2009 12:13:22 -0000 1.23.2.1
@@ -2,50 +2,73 @@
#define _GSB_REAL_H (1)
+/** \struct frac
+ * Describes a fractionary number
+ * */
+typedef struct
+{
+ gint32 num;
+ gint32 denom;
+} frac;
+
/** \struct
* Describe a real number.
* */
-typedef struct
+typedef struct
{
- glong mantissa;
- gint exponent;
+ gint32 ent;
+ frac f;
} gsb_real;
+/* START MACROS */
+// TRUE if r is valid (denom not null)
+#define GSB_REAL_VALID(r) (((r).f.denom)!=0)
+// TRUE if ent is null and num is null and denom not null
+#define GSB_REAL_NULL(r) (gsb_real_sign(r) == 0)
+// Returns -1 if integer is negative, 0 if null, and +1 if positive
+#define INT_SIGN(i) ((i) > 0 ? 1 : ((i)< 0 ? -1 : 0 ))
+// Returns -1 if gsb_real is negative, 0 if null, and +1 if positive
+#define GSB_REAL_SIGN(r) (gsb_real_sign(r))
+/* END MACROS */
/* START_INCLUDE_H */
/* END_INCLUDE_H */
/* START_DECLARATION */
-gsb_real gsb_str_to_real ( const gchar * str );
+static const gsb_real null_real = {0, {0, 1}};
+static const gsb_real error_real = {G_MAXINT32, {0, 0}};
+
gsb_real gsb_real_abs ( gsb_real number );
+gint gsb_real_sign ( gsb_real number );
+G_MODULE_EXPORT gsb_real gsb_real_opposite ( gsb_real number );
+G_MODULE_EXPORT gint gsb_real_cmp ( gsb_real number_1,
+ gsb_real number_2 );
+
G_MODULE_EXPORT gsb_real gsb_real_add ( gsb_real number_1,
gsb_real number_2 );
-gsb_real gsb_real_adjust_exponent ( gsb_real number,
- gint return_exponent );
-G_MODULE_EXPORT gint gsb_real_cmp ( gsb_real number_1,
+gsb_real gsb_real_sub ( gsb_real number_1,
+ gsb_real number_2 );
+gsb_real gsb_real_mul ( gsb_real number_1,
gsb_real number_2 );
gsb_real gsb_real_div ( gsb_real number_1,
gsb_real number_2 );
-G_MODULE_EXPORT gsb_real gsb_real_double_to_real ( gdouble number );
-gsb_real gsb_real_double_to_real_add_exponent ( gdouble number, gint exp_add );
+
+//gsb_real gsb_str_to_real ( const gchar * str );
gsb_real gsb_real_get_from_string ( const gchar *string );
+
gchar *gsb_real_get_string ( gsb_real number );
gchar *gsb_real_get_string_with_currency ( gsb_real number,
gint currency_number,
gboolean show_symbol );
-gsb_real gsb_real_inverse ( gsb_real number );
-gsb_real gsb_real_mul ( gsb_real number_1,
- gsb_real number_2 );
-gsb_real gsb_real_new ( gint mantissa, gint exponent );
-gboolean gsb_real_normalize ( gsb_real *number_1, gsb_real *number_2 );
-G_MODULE_EXPORT gsb_real gsb_real_opposite ( gsb_real number );
gchar *gsb_real_raw_format_string (gsb_real number,
struct lconv *conv,
- const gchar *currency_symbol );
-gsb_real gsb_real_raw_get_from_string ( const gchar *string,
- const gchar *mon_thousands_sep,
- const gchar *mon_decimal_point );
-gsb_real gsb_real_sub ( gsb_real number_1,
- gsb_real number_2 );
+ const gchar *currency_symbol,
+ gint floating_point );
+
+G_MODULE_EXPORT gsb_real gsb_real_double_to_real ( gdouble number );
+
+gsb_real gsb_real_adjust_exponent ( gsb_real number,
+ gint return_exponent );
+gboolean gsb_real_normalize ( gsb_real *number_1, gsb_real *number_2 );
/* END_DECLARATION */
#endif
- Next message: [grisbi-cvs] grisbi/src accueil.c, 1.218, 1.218.2.1 balance_estimate_tab.c, 1.23, 1.23.2.1 etats_affiche.c, 1.108, 1.108.2.1 etats_calculs.c, 1.133, 1.133.2.1 export_csv.c, 1.25, 1.25.2.1 file_obfuscate.c, 1.12, 1.12.2.1 gsb_account.c, 1.47, 1.47.2.1 gsb_account_property.c, 1.48, 1.48.2.1 gsb_autofunc.c, 1.24, 1.24.2.1 gsb_currency.c, 1.54, 1.54.2.1 gsb_currency_link_config.c, 1.18, 1.18.2.1 gsb_data_account.c, 1.91, 1.91.2.1 gsb_data_archive_store.c, 1.16, 1.16.2.1 gsb_data_budget.c, 1.54, 1.54.2.1 gsb_data_category.c, 1.71, 1.71.2.1 gsb_data_currency_link.c, 1.17, 1.17.2.1 gsb_data_partial_balance.c, 1.10, 1.10.2.1 gsb_data_payee.c, 1.50, 1.50.2.1 gsb_data_reconcile.c, 1.20, 1.20.2.1 gsb_data_report_amout_comparison.c, 1.14, 1.14.2.1 gsb_data_scheduled.c, 1.30, 1.30.2.1 gsb_data_transaction.c, 1.76, 1.76.2.1 gsb_debug.c, 1.14, 1.14.2.1 gsb_file_load.c, 1.192, 1.192.2.1 gsb_file_save.c, 1.143, 1.143.2.1 gsb_form.c, 1.137, 1.137.2.1 gsb_form_transaction.c, 1.51, 1.51.2.1 gsb_real.c, 1.59, 1.59.2.1 gsb_reconcile.c, 1.42, 1.42.2.1 gsb_rec oncile_config.c, 1.30, 1.30.2.1 gsb_reconcile_list.c, 1.10, 1.10.2.1 gsb_scheduler_list.c, 1.74, 1.74.2.1 gsb_transactions_list.c, 1.189, 1.189.2.1 gsb_transactions_list_sort.c, 1.21, 1.21.2.1 import.c, 1.308, 1.308.2.1 meta_budgetary.c, 1.37, 1.37.2.1 meta_categories.c, 1.48, 1.48.2.1 meta_payee.c, 1.35, 1.35.2.1 transaction_list.c, 1.52, 1.52.2.1 utils_editables.c, 1.32, 1.32.2.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the cvs
mailing list