Diffstat (limited to 'src/include/taler_amount_lib.h')
1 files changed, 31 insertions, 0 deletions
diff --git a/src/include/taler_amount_lib.h b/src/include/taler_amount_lib.h
index 7a0b299c..5defc37e 100644
@@ -64,6 +64,11 @@ extern "C"
#define TALER_AMOUNT_FRAC_LEN 8
+#define TALER_AMOUNT_MAX_VALUE (1LLU << 52)
@@ -332,6 +337,32 @@ TALER_amount_divide (struct TALER_Amount *result,
const struct TALER_Amount *dividend,
+ * Divide one amount by another. Note that this function
+ * may introduce a rounding error. It rounds down.
+ * @param dividend amount to divide
+ * @param divisor by what to divide, must be positive
+ * @return @a dividend / @a divisor, rounded down. -1 on currency missmatch,
+ * INT_MAX for division by zero
+TALER_amount_divide2 (const struct TALER_Amount *dividend,
+ const struct TALER_Amount *divisor);
+ * Multiply an @a amount by a @ factor.
+ * @param[out] result where to store @a amount * @a factor
+ * @param amount amount to multiply
+ * @param factor factor by which to multiply
+TALER_amount_multiply (struct TALER_Amount *result,
+ const struct TALER_Amount *amount,
+ uint32_t factor);
* Normalize the given amount.