13 static int dcmp(
const void *aa,
const void *bb)
25 static double mode(
double *value,
int argc)
31 qsort(value, argc,
sizeof(
double), dcmp);
33 for (i = 0; i < argc;) {
37 for (i++; i < argc; i++) {
53 int f_mode(
int argc,
const int *argt,
void **args)
56 static int value_size;
57 int size = argc *
sizeof(double);
63 for (i = 1; i <= argc; i++)
64 if (argt[i] != argt[0])
67 if (size > value_size) {
81 for (j = 0; j < argc && !nv; j++) {
85 value[j] = (double)argv[j][i];
91 res[i] = (
CELL) mode(value, argc);
100 for (i = 0; i <
columns; i++) {
103 for (j = 0; j < argc && !nv; j++) {
107 value[j] = (double)argv[j][i];
113 res[i] = (
FCELL) mode(value, argc);
119 DCELL *res = args[0];
122 for (i = 0; i <
columns; i++) {
125 for (j = 0; j < argc && !nv; j++) {
129 value[j] = (double)argv[j][i];
135 res[i] = (
DCELL) mode(value, argc);
int f_mode(int argc, const int *argt, void **args)