Commit 01d4d19c authored by Morten Welinder's avatar Morten Welinder Committed by Morten Welinder

Apply patch from hans@snow.nl, see bug 34844.

2000-12-11  Morten Welinder  <terra@diku.dk>

	* src/functions/fn-math.c (gnumeric_round): Apply patch from
 	hans@snow.nl, see bug 34844.
parent 6408a4e9
2000-12-11 Morten Welinder <terra@diku.dk>
* src/functions/fn-math.c (gnumeric_round): Apply patch from
hans@snow.nl, see bug 34844.
* src/functions/fn-math.c (help_int): fix bogus docs for negative
arguments.
......
2000-12-11 Morten Welinder <terra@diku.dk>
* src/functions/fn-math.c (gnumeric_round): Apply patch from
hans@snow.nl, see bug 34844.
* src/functions/fn-math.c (help_int): fix bogus docs for negative
arguments.
......
2000-12-11 Morten Welinder <terra@diku.dk>
* src/functions/fn-math.c (gnumeric_round): Apply patch from
hans@snow.nl, see bug 34844.
* src/functions/fn-math.c (help_int): fix bogus docs for negative
arguments.
......
2000-12-11 Morten Welinder <terra@diku.dk>
* src/functions/fn-math.c (gnumeric_round): Apply patch from
hans@snow.nl, see bug 34844.
* src/functions/fn-math.c (help_int): fix bogus docs for negative
arguments.
......
2000-12-11 Morten Welinder <terra@diku.dk>
* src/functions/fn-math.c (gnumeric_round): Apply patch from
hans@snow.nl, see bug 34844.
* src/functions/fn-math.c (help_int): fix bogus docs for negative
arguments.
......
......@@ -2094,7 +2094,10 @@ gnumeric_round (FunctionEvalInfo *ei, Value **argv)
digits = argv[1] ? value_get_as_int (argv[1]) : 0;
p10 = gpow10 (digits);
return value_new_float (floor (number * p10 + (number >= 0 ? 0.5 : -0.5)) / p10);
if (number < 0)
return value_new_float (-floor (-number * p10 + 0.5) / p10);
else
return value_new_float (floor (number * p10 + 0.5) / p10);
}
/***************************************************************************/
......
......@@ -2094,7 +2094,10 @@ gnumeric_round (FunctionEvalInfo *ei, Value **argv)
digits = argv[1] ? value_get_as_int (argv[1]) : 0;
p10 = gpow10 (digits);
return value_new_float (floor (number * p10 + (number >= 0 ? 0.5 : -0.5)) / p10);
if (number < 0)
return value_new_float (-floor (-number * p10 + 0.5) / p10);
else
return value_new_float (floor (number * p10 + 0.5) / p10);
}
/***************************************************************************/
......
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