From 0214e426a6cd2c80671bb55257e3358e737f60d3 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Mon, 6 Mar 2017 16:35:30 +0100 Subject: add amount division API and test case --- src/include/taler_amount_lib.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'src/include/taler_amount_lib.h') diff --git a/src/include/taler_amount_lib.h b/src/include/taler_amount_lib.h index 5a59c10ce..555894f4b 100644 --- a/src/include/taler_amount_lib.h +++ b/src/include/taler_amount_lib.h @@ -251,6 +251,20 @@ TALER_amount_add (struct TALER_Amount *sum, const struct TALER_Amount *a2); +/** + * Divide an amount by a float. Note that this function + * may introduce a rounding error! + * + * @param result where to store @a dividend / @a divisor + * @param dividend amount to divide + * @param divisor by what to divide, must be positive + */ +void +TALER_amount_divide (struct TALER_Amount *result, + const struct TALER_Amount *dividend, + uint32_t divisor); + + /** * Normalize the given amount. * -- cgit v1.2.3