13 static int dcmp(
const void *aa,
const void *bb)
25 static double mode(
double *value,
int argc)
36 qsort(value, argc,
sizeof(
double), dcmp);
38 for (i = 0; i < argc;) {
42 for (i++; i < argc; i++) {
58 int f_nmode(
int argc,
const int *argt,
void **args)
61 static int value_size;
62 int size = argc *
sizeof(double);
68 for (i = 1; i <= argc; i++)
69 if (argt[i] != argt[0])
72 if (size > value_size) {
86 for (j = 0; j < argc; j++) {
89 value[n++] = (double)argv[j][i];
95 res[i] = (
CELL) mode(value, n);
101 FCELL *res = args[0];
104 for (i = 0; i <
columns; i++) {
107 for (j = 0; j < argc; j++) {
110 value[n++] = (double)argv[j][i];
116 res[i] = (
FCELL) mode(value, n);
122 DCELL *res = args[0];
125 for (i = 0; i <
columns; i++) {
128 for (j = 0; j < argc; j++) {
131 value[n++] = (double)argv[j][i];
137 res[i] = (
DCELL) mode(value, n);
int f_nmode(int argc, const int *argt, void **args)