diff options
author | Nick Mathewson <nickm@torproject.org> | 2016-07-26 11:23:34 -0400 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2016-07-26 11:23:34 -0400 |
commit | 09c25697d74cdfdefe5fa365e4691cc9401e2129 (patch) | |
tree | a7a45a6d71af53d971fa94581ad5d75ceefedc79 /src/common/util.h | |
parent | 90ca4460489bbc92a8de8f32b8aa4bb82416dcbb (diff) | |
download | tor-09c25697d74cdfdefe5fa365e4691cc9401e2129.tar.gz tor-09c25697d74cdfdefe5fa365e4691cc9401e2129.zip |
Add a function to simplify a fraction.
Apparently remembering euclid's algorithm does pay off sooner or later.
Diffstat (limited to 'src/common/util.h')
-rw-r--r-- | src/common/util.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/common/util.h b/src/common/util.h index a6638aa39b..9face0c322 100644 --- a/src/common/util.h +++ b/src/common/util.h @@ -152,6 +152,8 @@ int64_t add_laplace_noise(int64_t signal, double random, double delta_f, double epsilon); int n_bits_set_u8(uint8_t v); int64_t clamp_double_to_int64(double number); +void simplify_fraction64(uint64_t *numer, uint64_t *denom); + /* Compute the CEIL of <b>a</b> divided by <b>b</b>, for nonnegative <b>a</b> * and positive <b>b</b>. Works on integer types only. Not defined if a+b can |