summaryrefslogtreecommitdiff
path: root/src/include/taler_amount_lib.h
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2017-03-06 16:35:30 +0100
committerChristian Grothoff <christian@grothoff.org>2017-03-06 16:35:30 +0100
commit0214e426a6cd2c80671bb55257e3358e737f60d3 (patch)
treec0acf2e8d730637482c6030647d01b17681a7413 /src/include/taler_amount_lib.h
parent326f3b2a43d9e18938cb2ac902b4cc9c7423f393 (diff)
downloadexchange-0214e426a6cd2c80671bb55257e3358e737f60d3.tar.gz
exchange-0214e426a6cd2c80671bb55257e3358e737f60d3.tar.bz2
exchange-0214e426a6cd2c80671bb55257e3358e737f60d3.zip
add amount division API and test case
Diffstat (limited to 'src/include/taler_amount_lib.h')
-rw-r--r--src/include/taler_amount_lib.h14
1 files changed, 14 insertions, 0 deletions
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
@@ -252,6 +252,20 @@ TALER_amount_add (struct TALER_Amount *sum,
/**
+ * 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.
*
* @param amount amount to normalize