22 int find_nth_int(
int *array,
int n_elements,
int nth);
23 time_t find_nth_time(time_t *array,
int n_elements,
int nth);
24 double find_nth_double(
double *array,
int n_elements,
int nth);
25 int32_t find_nth_int32(int32_t *array,
int n_elements,
int nth);
26 uint32_t find_nth_uint32(uint32_t *array,
int n_elements,
int nth);
27 long find_nth_long(
long *array,
int n_elements,
int nth);
29 median_int(
int *array,
int n_elements)
31 return find_nth_int(array, n_elements, (n_elements-1)/2);
34 median_time(time_t *array,
int n_elements)
36 return find_nth_time(array, n_elements, (n_elements-1)/2);
39 median_double(
double *array,
int n_elements)
41 return find_nth_double(array, n_elements, (n_elements-1)/2);
43 static inline uint32_t
44 median_uint32(uint32_t *array,
int n_elements)
46 return find_nth_uint32(array, n_elements, (n_elements-1)/2);
49 median_int32(int32_t *array,
int n_elements)
51 return find_nth_int32(array, n_elements, (n_elements-1)/2);
54 static inline uint32_t
55 third_quartile_uint32(uint32_t *array,
int n_elements)
57 return find_nth_uint32(array, n_elements, (n_elements*3)/4);
Utility macros to handle different features and behavior in different compilers.
Integer definitions used throughout Tor.