Tor
0.4.7.0-alpha-dev
|
Go to the source code of this file.
Functions | |
double | tor_mathlog (double d) ATTR_CONST |
long | tor_lround (double d) ATTR_CONST |
int64_t | tor_llround (double d) ATTR_CONST |
int64_t | clamp_double_to_int64 (double number) |
int | tor_isinf (double x) |
int64_t clamp_double_to_int64 | ( | double | number | ) |
Cast a given double value to a int64_t. Return 0 if number is NaN. Returns either INT64_MIN or INT64_MAX if number is outside of the int64_t range.
Definition at line 61 of file fp.c.
Referenced by sample_laplace_distribution().
int64_t tor_llround | ( | double | d | ) |
Return the 64-bit integer closest to d. We define this wrapper here so that not all users of math.h need to use the right incantations to get the c99 functions.
Definition at line 46 of file fp.c.
Referenced by scale_array_elements_to_u64().
long tor_lround | ( | double | d | ) |
Return the long integer closest to d. We define this wrapper here so that not all users of math.h need to use the right incantations to get the c99 functions.
Definition at line 31 of file fp.c.
Referenced by circuit_build_times_close_quantile(), and circuit_build_times_set_timeout().
double tor_mathlog | ( | double | d | ) |
Returns the natural logarithm of d base e. We defined this wrapper here so to avoid conflicts with old versions of tor_log(), which were named log().
Definition at line 22 of file fp.c.
Referenced by circuit_build_times_update_alpha(), and sample_laplace_distribution().