Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
gnumeric
Commits
4a9c1dd7
Commit
4a9c1dd7
authored
Jun 14, 1999
by
Morten Welinder
Browse files
Fix SERIESSUM.
parent
577618f6
Changes
7
Hide whitespace changes
Inline
Side-by-side
ChangeLog-1999-07-09
View file @
4a9c1dd7
1999-06-14 Morten Welinder <terra@diku.dk>
* src/fn-math.c (callback_function_seriessum): Simplify.
(gnumeric_seriessum): Don't round x, n, and m to integers. Fix
error handling.
* src/fn-math.c (pow10): New function.
(gnumeric_rounddown): Simplify and correct.
(gnumeric_round): Ditto.
...
...
ChangeLog-2000-02-23
View file @
4a9c1dd7
1999-06-14 Morten Welinder <terra@diku.dk>
* src/fn-math.c (callback_function_seriessum): Simplify.
(gnumeric_seriessum): Don't round x, n, and m to integers. Fix
error handling.
* src/fn-math.c (pow10): New function.
(gnumeric_rounddown): Simplify and correct.
(gnumeric_round): Ditto.
...
...
OChangeLog-1999-07-09
View file @
4a9c1dd7
1999-06-14 Morten Welinder <terra@diku.dk>
* src/fn-math.c (callback_function_seriessum): Simplify.
(gnumeric_seriessum): Don't round x, n, and m to integers. Fix
error handling.
* src/fn-math.c (pow10): New function.
(gnumeric_rounddown): Simplify and correct.
(gnumeric_round): Ditto.
...
...
OChangeLog-2000-02-23
View file @
4a9c1dd7
1999-06-14 Morten Welinder <terra@diku.dk>
* src/fn-math.c (callback_function_seriessum): Simplify.
(gnumeric_seriessum): Don't round x, n, and m to integers. Fix
error handling.
* src/fn-math.c (pow10): New function.
(gnumeric_rounddown): Simplify and correct.
(gnumeric_round): Ditto.
...
...
plugins/fn-math/functions.c
View file @
4a9c1dd7
...
...
@@ -2421,18 +2421,12 @@ callback_function_seriessum (Sheet *sheet, Value *value,
char
**
error_string
,
void
*
closure
)
{
math_seriessum_t
*
mm
=
closure
;
float_t
coefficient
=
0
;
float_t
coefficient
;
switch
(
value
->
type
){
case
VALUE_INTEGER
:
coefficient
=
value
->
v
.
v_int
;
break
;
case
VALUE_FLOAT
:
coefficient
=
value
->
v
.
v_float
;
break
;
default:
return
FALSE
;
}
if
(
!
VALUE_IS_NUMBER
(
value
))
return
FALSE
;
coefficient
=
value_get_as_float
(
value
);
mm
->
sum
+=
coefficient
*
pow
(
mm
->
x
,
mm
->
n
);
mm
->
n
+=
mm
->
m
;
...
...
@@ -2461,11 +2455,12 @@ gnumeric_seriessum (Sheet *sheet, GList *expr_node_list,
return
NULL
;
}
val
=
eval_expr
(
sheet
,
tree
,
eval_col
,
eval_row
,
error_string
);
if
(
!
VALUE_IS_NUMBER
(
val
))
{
if
(
!
val
)
return
NULL
;
if
(
!
VALUE_IS_NUMBER
(
val
))
{
*
error_string
=
gnumeric_err_VALUE
;
return
NULL
;
}
x
=
value_get_as_
int
(
val
);
x
=
value_get_as_
float
(
val
);
expr_node_list
=
expr_node_list
->
next
;
/* Get n */
...
...
@@ -2475,11 +2470,12 @@ gnumeric_seriessum (Sheet *sheet, GList *expr_node_list,
return
NULL
;
}
val
=
eval_expr
(
sheet
,
tree
,
eval_col
,
eval_row
,
error_string
);
if
(
!
VALUE_IS_NUMBER
(
val
))
{
if
(
!
val
)
return
NULL
;
if
(
!
VALUE_IS_NUMBER
(
val
))
{
*
error_string
=
gnumeric_err_VALUE
;
return
NULL
;
}
n
=
value_get_as_
int
(
val
);
n
=
value_get_as_
float
(
val
);
expr_node_list
=
expr_node_list
->
next
;
/* Get m */
...
...
@@ -2489,11 +2485,12 @@ gnumeric_seriessum (Sheet *sheet, GList *expr_node_list,
return
NULL
;
}
val
=
eval_expr
(
sheet
,
tree
,
eval_col
,
eval_row
,
error_string
);
if
(
!
VALUE_IS_NUMBER
(
val
))
{
if
(
!
val
)
return
NULL
;
if
(
!
VALUE_IS_NUMBER
(
val
))
{
*
error_string
=
gnumeric_err_VALUE
;
return
NULL
;
}
m
=
value_get_as_
int
(
val
);
m
=
value_get_as_
float
(
val
);
expr_node_list
=
expr_node_list
->
next
;
p
.
n
=
n
;
...
...
src/fn-math.c
View file @
4a9c1dd7
...
...
@@ -2421,18 +2421,12 @@ callback_function_seriessum (Sheet *sheet, Value *value,
char
**
error_string
,
void
*
closure
)
{
math_seriessum_t
*
mm
=
closure
;
float_t
coefficient
=
0
;
float_t
coefficient
;
switch
(
value
->
type
){
case
VALUE_INTEGER
:
coefficient
=
value
->
v
.
v_int
;
break
;
case
VALUE_FLOAT
:
coefficient
=
value
->
v
.
v_float
;
break
;
default:
return
FALSE
;
}
if
(
!
VALUE_IS_NUMBER
(
value
))
return
FALSE
;
coefficient
=
value_get_as_float
(
value
);
mm
->
sum
+=
coefficient
*
pow
(
mm
->
x
,
mm
->
n
);
mm
->
n
+=
mm
->
m
;
...
...
@@ -2461,11 +2455,12 @@ gnumeric_seriessum (Sheet *sheet, GList *expr_node_list,
return
NULL
;
}
val
=
eval_expr
(
sheet
,
tree
,
eval_col
,
eval_row
,
error_string
);
if
(
!
VALUE_IS_NUMBER
(
val
))
{
if
(
!
val
)
return
NULL
;
if
(
!
VALUE_IS_NUMBER
(
val
))
{
*
error_string
=
gnumeric_err_VALUE
;
return
NULL
;
}
x
=
value_get_as_
int
(
val
);
x
=
value_get_as_
float
(
val
);
expr_node_list
=
expr_node_list
->
next
;
/* Get n */
...
...
@@ -2475,11 +2470,12 @@ gnumeric_seriessum (Sheet *sheet, GList *expr_node_list,
return
NULL
;
}
val
=
eval_expr
(
sheet
,
tree
,
eval_col
,
eval_row
,
error_string
);
if
(
!
VALUE_IS_NUMBER
(
val
))
{
if
(
!
val
)
return
NULL
;
if
(
!
VALUE_IS_NUMBER
(
val
))
{
*
error_string
=
gnumeric_err_VALUE
;
return
NULL
;
}
n
=
value_get_as_
int
(
val
);
n
=
value_get_as_
float
(
val
);
expr_node_list
=
expr_node_list
->
next
;
/* Get m */
...
...
@@ -2489,11 +2485,12 @@ gnumeric_seriessum (Sheet *sheet, GList *expr_node_list,
return
NULL
;
}
val
=
eval_expr
(
sheet
,
tree
,
eval_col
,
eval_row
,
error_string
);
if
(
!
VALUE_IS_NUMBER
(
val
))
{
if
(
!
val
)
return
NULL
;
if
(
!
VALUE_IS_NUMBER
(
val
))
{
*
error_string
=
gnumeric_err_VALUE
;
return
NULL
;
}
m
=
value_get_as_
int
(
val
);
m
=
value_get_as_
float
(
val
);
expr_node_list
=
expr_node_list
->
next
;
p
.
n
=
n
;
...
...
src/functions/fn-math.c
View file @
4a9c1dd7
...
...
@@ -2421,18 +2421,12 @@ callback_function_seriessum (Sheet *sheet, Value *value,
char
**
error_string
,
void
*
closure
)
{
math_seriessum_t
*
mm
=
closure
;
float_t
coefficient
=
0
;
float_t
coefficient
;
switch
(
value
->
type
){
case
VALUE_INTEGER
:
coefficient
=
value
->
v
.
v_int
;
break
;
case
VALUE_FLOAT
:
coefficient
=
value
->
v
.
v_float
;
break
;
default:
return
FALSE
;
}
if
(
!
VALUE_IS_NUMBER
(
value
))
return
FALSE
;
coefficient
=
value_get_as_float
(
value
);
mm
->
sum
+=
coefficient
*
pow
(
mm
->
x
,
mm
->
n
);
mm
->
n
+=
mm
->
m
;
...
...
@@ -2461,11 +2455,12 @@ gnumeric_seriessum (Sheet *sheet, GList *expr_node_list,
return
NULL
;
}
val
=
eval_expr
(
sheet
,
tree
,
eval_col
,
eval_row
,
error_string
);
if
(
!
VALUE_IS_NUMBER
(
val
))
{
if
(
!
val
)
return
NULL
;
if
(
!
VALUE_IS_NUMBER
(
val
))
{
*
error_string
=
gnumeric_err_VALUE
;
return
NULL
;
}
x
=
value_get_as_
int
(
val
);
x
=
value_get_as_
float
(
val
);
expr_node_list
=
expr_node_list
->
next
;
/* Get n */
...
...
@@ -2475,11 +2470,12 @@ gnumeric_seriessum (Sheet *sheet, GList *expr_node_list,
return
NULL
;
}
val
=
eval_expr
(
sheet
,
tree
,
eval_col
,
eval_row
,
error_string
);
if
(
!
VALUE_IS_NUMBER
(
val
))
{
if
(
!
val
)
return
NULL
;
if
(
!
VALUE_IS_NUMBER
(
val
))
{
*
error_string
=
gnumeric_err_VALUE
;
return
NULL
;
}
n
=
value_get_as_
int
(
val
);
n
=
value_get_as_
float
(
val
);
expr_node_list
=
expr_node_list
->
next
;
/* Get m */
...
...
@@ -2489,11 +2485,12 @@ gnumeric_seriessum (Sheet *sheet, GList *expr_node_list,
return
NULL
;
}
val
=
eval_expr
(
sheet
,
tree
,
eval_col
,
eval_row
,
error_string
);
if
(
!
VALUE_IS_NUMBER
(
val
))
{
if
(
!
val
)
return
NULL
;
if
(
!
VALUE_IS_NUMBER
(
val
))
{
*
error_string
=
gnumeric_err_VALUE
;
return
NULL
;
}
m
=
value_get_as_
int
(
val
);
m
=
value_get_as_
float
(
val
);
expr_node_list
=
expr_node_list
->
next
;
p
.
n
=
n
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment