Commit 8fbf3bf6 authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Use gnum_float instead of double. Ditto. Ditto.

2002-02-19  Morten Welinder  <terra@diku.dk>

	* src/sheet-autofill.c (autofill_cell): Use gnum_float instead of
	double.
	* src/expr.c (expr_eval_real): Ditto.
	* src/datetime.c (datetime_timet_to_serial_raw): Ditto.
parent 57712f32
2002-02-19 Morten Welinder <terra@diku.dk>
* src/sheet-autofill.c (autofill_cell): Use gnum_float instead of
double.
* src/expr.c (expr_eval_real): Ditto.
* src/datetime.c (datetime_timet_to_serial_raw): Ditto.
* src/format.c (format_compile): Fix isdigit usage.
* src/value.c (value_diff): Return a gnum_float, not a double.
......
2002-02-19 Morten Welinder <terra@diku.dk>
* src/sheet-autofill.c (autofill_cell): Use gnum_float instead of
double.
* src/expr.c (expr_eval_real): Ditto.
* src/datetime.c (datetime_timet_to_serial_raw): Ditto.
* src/format.c (format_compile): Fix isdigit usage.
* src/value.c (value_diff): Return a gnum_float, not a double.
......
2002-02-19 Morten Welinder <terra@diku.dk>
* src/sheet-autofill.c (autofill_cell): Use gnum_float instead of
double.
* src/expr.c (expr_eval_real): Ditto.
* src/datetime.c (datetime_timet_to_serial_raw): Ditto.
* src/format.c (format_compile): Fix isdigit usage.
* src/value.c (value_diff): Return a gnum_float, not a double.
......
......@@ -117,7 +117,7 @@ datetime_timet_to_serial_raw (time_t t)
g_date_clear (&date, 1);
g_date_set_time (&date, t);
secs = tm->tm_hour * 3600 + tm->tm_min * 60 + tm->tm_sec;
return datetime_g_to_serial (&date) + secs / (double)SECS_PER_DAY;
return datetime_g_to_serial (&date) + secs / (gnum_float)SECS_PER_DAY;
}
/* ------------------------------------------------------------------------- */
......
......@@ -639,7 +639,7 @@ expr_eval_real (ExprTree const *expr, EvalPos const *pos,
if (a->type != VALUE_FLOAT && b->type != VALUE_FLOAT){
int ia = value_get_as_int (a);
int ib = value_get_as_int (b);
double dres;
gnum_float dres;
int ires;
value_release (a);
......@@ -649,7 +649,7 @@ expr_eval_real (ExprTree const *expr, EvalPos const *pos,
catch most cases where overflow will not happen. */
switch (expr->any.oper){
case OPER_ADD:
dres = (double)ia + (double)ib;
dres = (gnum_float)ia + (gnum_float)ib;
ires = (int)dres;
if (dres == ires)
return value_new_int (ires);
......@@ -657,7 +657,7 @@ expr_eval_real (ExprTree const *expr, EvalPos const *pos,
return value_new_float ((gnum_float) dres);
case OPER_SUB:
dres = (double)ia - (double)ib;
dres = (gnum_float)ia - (gnum_float)ib;
ires = (int)dres;
if (dres == ires)
return value_new_int (ires);
......@@ -665,7 +665,7 @@ expr_eval_real (ExprTree const *expr, EvalPos const *pos,
return value_new_float ((gnum_float) dres);
case OPER_MULT:
dres = (double)ia * (double)ib;
dres = (gnum_float)ia * (gnum_float)ib;
ires = (int)dres;
if (dres == ires)
return value_new_int (ires);
......@@ -675,7 +675,7 @@ expr_eval_real (ExprTree const *expr, EvalPos const *pos,
case OPER_DIV:
if (ib == 0)
return value_new_error (pos, gnumeric_err_DIV0);
dres = (double)ia / (double)ib;
dres = (gnum_float)ia / (gnum_float)ib;
ires = (int)dres;
if (dres == ires)
return value_new_int (ires);
......@@ -685,7 +685,7 @@ expr_eval_real (ExprTree const *expr, EvalPos const *pos,
case OPER_EXP:
if (ia == 0 && ib <= 0)
return value_new_error (pos, gnumeric_err_NUM);
dres = pow ((double)ia, (double)ib);
dres = pow ((gnum_float)ia, (gnum_float)ib);
ires = (int)dres;
if (dres == ires)
return value_new_int (ires);
......
......@@ -125,8 +125,8 @@ typedef struct _FillItem {
gboolean delta_is_float;
union {
double d_float;
int d_int;
gnum_float d_float;
int d_int;
} delta;
struct _FillItem *group_last;
......@@ -401,7 +401,7 @@ autofill_compute_delta (GList *list_last, gboolean singleton_increment)
/* fall through */
case FILL_NUMBER: {
double a, b;
gnum_float a, b;
if (list_last->prev == NULL) {
if ((fi->delta_is_float = (VALUE_TYPE (fi->v.value) == VALUE_FLOAT)))
......@@ -616,7 +616,7 @@ autofill_cell (FillItem *fi, Cell *cell, int idx, int limit_x, int limit_y)
Value *v;
if (delta->delta_is_float) {
double const d = value_get_as_float (delta->v.value);
const gnum_float d = value_get_as_float (delta->v.value);
v = value_new_float (d + idx * delta->delta.d_float);
} else {
int const i = value_get_as_int (delta->v.value);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment