这不是我的所有代码,但这是我的设置。当我尝试计算平均值时,我得到inf
了答案。相反,我应该得到一个小数。我投错了吗?我究竟做错了什么?
typedef struct hash_table_ {
data_el **order;
int *number_next_calls;
int *number_buckets;
int *buckets_size;
int *worst;
int *total;
float *average;
int (*hash_func)(char *);
int (*comp_func)(void*, void*);
data_el **buckets_array;
} hash_table, *Phash_table;
...
Phash_table table;
...
int temp_total,temp_buckets_size;
temp_total = *table->total;
temp_buckets_size = *table->buckets_size;
*(table->average) = (float)temp_total/(float)temp_buckets_size;
printf("%f\n",*(table->average));