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
99a990bb
Commit
99a990bb
authored
Mar 13, 1999
by
Michael Meeks
Browse files
Implemented 4 new engineering functions.
parent
30ed3786
Changes
13
Hide whitespace changes
Inline
Side-by-side
ChangeLog-1999-07-09
View file @
99a990bb
1999-03-13 Michael Meeks <michael@imaginator.com>
* src/fn-eng.c: Created
(gnumeric_erf, gnumeric_erfc, gnumeric_bessely)
(gnumeric_besselj): Implemented
(gnumeric_bin2dec): Moved from fn-math.c
* src/fn-math.c (gnumeric_bin2dec): Moved to fn-eng
* src/func.c (functions_init): Added eng_functions.
* src/fn-stat.c: Cleaned functions help.
* src/Makefile.am: Added fn-eng.c
1999-03-11 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/clipboard.c (sheet_paste_selection): New routine. Abstracts
...
...
ChangeLog-2000-02-23
View file @
99a990bb
1999-03-13 Michael Meeks <michael@imaginator.com>
* src/fn-eng.c: Created
(gnumeric_erf, gnumeric_erfc, gnumeric_bessely)
(gnumeric_besselj): Implemented
(gnumeric_bin2dec): Moved from fn-math.c
* src/fn-math.c (gnumeric_bin2dec): Moved to fn-eng
* src/func.c (functions_init): Added eng_functions.
* src/fn-stat.c: Cleaned functions help.
* src/Makefile.am: Added fn-eng.c
1999-03-11 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/clipboard.c (sheet_paste_selection): New routine. Abstracts
...
...
OChangeLog-1999-07-09
View file @
99a990bb
1999-03-13 Michael Meeks <michael@imaginator.com>
* src/fn-eng.c: Created
(gnumeric_erf, gnumeric_erfc, gnumeric_bessely)
(gnumeric_besselj): Implemented
(gnumeric_bin2dec): Moved from fn-math.c
* src/fn-math.c (gnumeric_bin2dec): Moved to fn-eng
* src/func.c (functions_init): Added eng_functions.
* src/fn-stat.c: Cleaned functions help.
* src/Makefile.am: Added fn-eng.c
1999-03-11 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/clipboard.c (sheet_paste_selection): New routine. Abstracts
...
...
OChangeLog-2000-02-23
View file @
99a990bb
1999-03-13 Michael Meeks <michael@imaginator.com>
* src/fn-eng.c: Created
(gnumeric_erf, gnumeric_erfc, gnumeric_bessely)
(gnumeric_besselj): Implemented
(gnumeric_bin2dec): Moved from fn-math.c
* src/fn-math.c (gnumeric_bin2dec): Moved to fn-eng
* src/func.c (functions_init): Added eng_functions.
* src/fn-stat.c: Cleaned functions help.
* src/Makefile.am: Added fn-eng.c
1999-03-11 Miguel de Icaza <miguel@nuclecu.unam.mx>
* src/clipboard.c (sheet_paste_selection): New routine. Abstracts
...
...
plugins/fn-math/functions.c
View file @
99a990bb
...
...
@@ -382,56 +382,6 @@ gnumeric_ceil (struct FunctionDefinition *i, Value *argv [], char **error_string
return
value_float
(
ceil
(
value_get_as_double
(
argv
[
0
])));
}
static
char
*
help_bin2dec
=
{
N_
(
"@FUNCTION=BIN2DEC
\n
"
"@SYNTAX=BIN2DEC(x)
\n
"
"@DESCRIPTION="
"The BIN2DEC function converts a binary number "
"in string or number to its decimal equivalent."
"
\n
"
"Performing this function on a string or empty cell simply does nothing."
"
\n
"
"@SEEALSO=DEC2BIN"
)
};
static
Value
*
gnumeric_bin2dec
(
struct
FunctionDefinition
*
i
,
Value
*
argv
[],
char
**
error_string
)
{
int
result
,
v
,
n
,
bit
;
char
*
p
;
result
=
0
;
switch
(
argv
[
0
]
->
type
){
case
VALUE_INTEGER
:
v
=
argv
[
0
]
->
v
.
v_int
;
n
=
0
;
for
(
n
=
0
;
v
;
n
++
){
bit
=
v
%
10
;
v
=
v
/
10
;
result
|=
bit
<<
n
;
}
break
;
case
VALUE_STRING
:
p
=
argv
[
0
]
->
v
.
str
->
str
;
for
(;
*
p
;
p
++
){
if
(
!
(
*
p
==
'0'
||
*
p
==
'1'
)){
*
error_string
=
"#NUM!"
;
return
NULL
;
}
result
=
result
<<
1
|
(
*
p
-
'0'
);
}
break
;
default:
*
error_string
=
"#NUM!"
;
return
NULL
;
}
return
value_int
(
result
);
}
static
char
*
help_cos
=
{
N_
(
"@FUNCTION=COS
\n
"
"@SYNTAX=COS(x)
\n
"
...
...
@@ -1218,11 +1168,6 @@ FunctionDefinition math_functions [] = {
{
"atan2"
,
"ff"
,
"xnum,ynum"
,
&
help_atan2
,
NULL
,
gnumeric_atan2
},
/* avedev */
{
"average"
,
0
,
""
,
&
help_average
,
gnumeric_average
,
NULL
},
/* besseli */
/* besselj */
/* besselk */
/* bessely */
{
"bin2dec"
,
"?"
,
"number"
,
&
help_bin2dec
,
NULL
,
gnumeric_bin2dec
},
{
"cos"
,
"f"
,
"number"
,
&
help_cos
,
NULL
,
gnumeric_cos
},
{
"cosh"
,
"f"
,
"number"
,
&
help_cosh
,
NULL
,
gnumeric_cosh
},
{
"count"
,
0
,
""
,
&
help_count
,
gnumeric_count
,
NULL
},
...
...
plugins/fn-stat/functions.c
View file @
99a990bb
...
...
@@ -256,8 +256,8 @@ static char *help_expondist = {
"The EXPONDIST function returns the exponential distribution "
"If the cumulative boolean is false it will return: "
"y * exp (-y*x), otherwise it will return 1 - exp (-y*x). "
"If x<0 or y<=0 this will return an error"
"
\n
"
"If x<0 or y<=0 this will return an error"
"Performing this function on a string or empty cell simply does nothing. "
"
\n
"
"@SEEALSO=POISSON"
)
...
...
src/Makefile.am
View file @
99a990bb
...
...
@@ -48,11 +48,12 @@ GNUMERIC_BASE_SOURCES = \
func.c
\
func.h
\
fn-date.c
\
fn-eng.c
\
fn-financial.c
\
fn-math.c
\
fn-stat.c
\
fn-misc.c
\
fn-sheet.c
\
fn-stat.c
\
fn-string.c
\
format.c
\
format.h
\
...
...
src/fn-math.c
View file @
99a990bb
...
...
@@ -382,56 +382,6 @@ gnumeric_ceil (struct FunctionDefinition *i, Value *argv [], char **error_string
return
value_float
(
ceil
(
value_get_as_double
(
argv
[
0
])));
}
static
char
*
help_bin2dec
=
{
N_
(
"@FUNCTION=BIN2DEC
\n
"
"@SYNTAX=BIN2DEC(x)
\n
"
"@DESCRIPTION="
"The BIN2DEC function converts a binary number "
"in string or number to its decimal equivalent."
"
\n
"
"Performing this function on a string or empty cell simply does nothing."
"
\n
"
"@SEEALSO=DEC2BIN"
)
};
static
Value
*
gnumeric_bin2dec
(
struct
FunctionDefinition
*
i
,
Value
*
argv
[],
char
**
error_string
)
{
int
result
,
v
,
n
,
bit
;
char
*
p
;
result
=
0
;
switch
(
argv
[
0
]
->
type
){
case
VALUE_INTEGER
:
v
=
argv
[
0
]
->
v
.
v_int
;
n
=
0
;
for
(
n
=
0
;
v
;
n
++
){
bit
=
v
%
10
;
v
=
v
/
10
;
result
|=
bit
<<
n
;
}
break
;
case
VALUE_STRING
:
p
=
argv
[
0
]
->
v
.
str
->
str
;
for
(;
*
p
;
p
++
){
if
(
!
(
*
p
==
'0'
||
*
p
==
'1'
)){
*
error_string
=
"#NUM!"
;
return
NULL
;
}
result
=
result
<<
1
|
(
*
p
-
'0'
);
}
break
;
default:
*
error_string
=
"#NUM!"
;
return
NULL
;
}
return
value_int
(
result
);
}
static
char
*
help_cos
=
{
N_
(
"@FUNCTION=COS
\n
"
"@SYNTAX=COS(x)
\n
"
...
...
@@ -1218,11 +1168,6 @@ FunctionDefinition math_functions [] = {
{
"atan2"
,
"ff"
,
"xnum,ynum"
,
&
help_atan2
,
NULL
,
gnumeric_atan2
},
/* avedev */
{
"average"
,
0
,
""
,
&
help_average
,
gnumeric_average
,
NULL
},
/* besseli */
/* besselj */
/* besselk */
/* bessely */
{
"bin2dec"
,
"?"
,
"number"
,
&
help_bin2dec
,
NULL
,
gnumeric_bin2dec
},
{
"cos"
,
"f"
,
"number"
,
&
help_cos
,
NULL
,
gnumeric_cos
},
{
"cosh"
,
"f"
,
"number"
,
&
help_cosh
,
NULL
,
gnumeric_cosh
},
{
"count"
,
0
,
""
,
&
help_count
,
gnumeric_count
,
NULL
},
...
...
src/fn-stat.c
View file @
99a990bb
...
...
@@ -256,8 +256,8 @@ static char *help_expondist = {
"The EXPONDIST function returns the exponential distribution "
"If the cumulative boolean is false it will return: "
"y * exp (-y*x), otherwise it will return 1 - exp (-y*x). "
"If x<0 or y<=0 this will return an error"
"
\n
"
"If x<0 or y<=0 this will return an error"
"Performing this function on a string or empty cell simply does nothing. "
"
\n
"
"@SEEALSO=POISSON"
)
...
...
src/func.c
View file @
99a990bb
...
...
@@ -160,6 +160,7 @@ functions_init (void)
install_symbols
(
string_functions
);
install_symbols
(
stat_functions
);
install_symbols
(
finance_functions
);
install_symbols
(
eng_functions
);
}
void
...
...
src/func.h
View file @
99a990bb
...
...
@@ -8,6 +8,7 @@ extern FunctionDefinition date_functions [];
extern
FunctionDefinition
string_functions
[];
extern
FunctionDefinition
stat_functions
[];
extern
FunctionDefinition
finance_functions
[];
extern
FunctionDefinition
eng_functions
[];
typedef
int
(
*
FunctionIterateCallback
)(
Sheet
*
sheet
,
Value
*
value
,
char
**
error_string
,
void
*
);
...
...
src/functions/fn-math.c
View file @
99a990bb
...
...
@@ -382,56 +382,6 @@ gnumeric_ceil (struct FunctionDefinition *i, Value *argv [], char **error_string
return
value_float
(
ceil
(
value_get_as_double
(
argv
[
0
])));
}
static
char
*
help_bin2dec
=
{
N_
(
"@FUNCTION=BIN2DEC
\n
"
"@SYNTAX=BIN2DEC(x)
\n
"
"@DESCRIPTION="
"The BIN2DEC function converts a binary number "
"in string or number to its decimal equivalent."
"
\n
"
"Performing this function on a string or empty cell simply does nothing."
"
\n
"
"@SEEALSO=DEC2BIN"
)
};
static
Value
*
gnumeric_bin2dec
(
struct
FunctionDefinition
*
i
,
Value
*
argv
[],
char
**
error_string
)
{
int
result
,
v
,
n
,
bit
;
char
*
p
;
result
=
0
;
switch
(
argv
[
0
]
->
type
){
case
VALUE_INTEGER
:
v
=
argv
[
0
]
->
v
.
v_int
;
n
=
0
;
for
(
n
=
0
;
v
;
n
++
){
bit
=
v
%
10
;
v
=
v
/
10
;
result
|=
bit
<<
n
;
}
break
;
case
VALUE_STRING
:
p
=
argv
[
0
]
->
v
.
str
->
str
;
for
(;
*
p
;
p
++
){
if
(
!
(
*
p
==
'0'
||
*
p
==
'1'
)){
*
error_string
=
"#NUM!"
;
return
NULL
;
}
result
=
result
<<
1
|
(
*
p
-
'0'
);
}
break
;
default:
*
error_string
=
"#NUM!"
;
return
NULL
;
}
return
value_int
(
result
);
}
static
char
*
help_cos
=
{
N_
(
"@FUNCTION=COS
\n
"
"@SYNTAX=COS(x)
\n
"
...
...
@@ -1218,11 +1168,6 @@ FunctionDefinition math_functions [] = {
{
"atan2"
,
"ff"
,
"xnum,ynum"
,
&
help_atan2
,
NULL
,
gnumeric_atan2
},
/* avedev */
{
"average"
,
0
,
""
,
&
help_average
,
gnumeric_average
,
NULL
},
/* besseli */
/* besselj */
/* besselk */
/* bessely */
{
"bin2dec"
,
"?"
,
"number"
,
&
help_bin2dec
,
NULL
,
gnumeric_bin2dec
},
{
"cos"
,
"f"
,
"number"
,
&
help_cos
,
NULL
,
gnumeric_cos
},
{
"cosh"
,
"f"
,
"number"
,
&
help_cosh
,
NULL
,
gnumeric_cosh
},
{
"count"
,
0
,
""
,
&
help_count
,
gnumeric_count
,
NULL
},
...
...
src/functions/fn-stat.c
View file @
99a990bb
...
...
@@ -256,8 +256,8 @@ static char *help_expondist = {
"The EXPONDIST function returns the exponential distribution "
"If the cumulative boolean is false it will return: "
"y * exp (-y*x), otherwise it will return 1 - exp (-y*x). "
"If x<0 or y<=0 this will return an error"
"
\n
"
"If x<0 or y<=0 this will return an error"
"Performing this function on a string or empty cell simply does nothing. "
"
\n
"
"@SEEALSO=POISSON"
)
...
...
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