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_nmode(
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; j++) {
84 value[n++] = (double)argv[j][i];
90 res[i] = (
CELL) mode(value, n);
102 for (j = 0; j < argc; j++) {
105 value[n++] = (double)argv[j][i];
111 res[i] = (
FCELL) mode(value, n);
117 DCELL *res = args[0];
120 for (i = 0; i <
columns; i++) {
123 for (j = 0; j < argc; j++) {
126 value[n++] = (double)argv[j][i];
132 res[i] = (
DCELL) mode(value, n);
int f_nmode(int argc, const int *argt, void **args)