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_mode(
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 && !nv; j++) {
90 value[j] = (double)argv[j][i];
96 res[i] = (
CELL) mode(value, argc);
102 FCELL *res = args[0];
105 for (i = 0; i <
columns; i++) {
108 for (j = 0; j < argc && !nv; j++) {
112 value[j] = (double)argv[j][i];
118 res[i] = (
FCELL) mode(value, argc);
124 DCELL *res = args[0];
127 for (i = 0; i <
columns; i++) {
130 for (j = 0; j < argc && !nv; j++) {
134 value[j] = (double)argv[j][i];
140 res[i] = (
DCELL) mode(value, argc);
int f_mode(int argc, const int *argt, void **args)