From 35f9e979316bfd91bc2e968486a20e36f9783a44 Mon Sep 17 00:00:00 2001 From: Pekka Riikonen Date: Fri, 10 Jan 2003 17:39:11 +0000 Subject: [PATCH] Comment fixes. --- lib/silcmath/silcmp.h | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/lib/silcmath/silcmp.h b/lib/silcmath/silcmp.h index da72aa91..ba18ae35 100644 --- a/lib/silcmath/silcmp.h +++ b/lib/silcmath/silcmp.h @@ -106,10 +106,16 @@ size_t silc_mp_size(SilcMPInt *mp); * * DESCRIPTION * - * Return the size of the integer in base `base'. Note that this size - * is probably only an approximation. However, it is guaranteed that - * the returned size is always at least the size of the integer, however, - * it may be larger. + * Return the size of the integer in base `base'. + * + * NOTES + * + * For any other base but 2 this function usually returns only an + * approximated size in the base. It is however guaranteed that the + * the returned size is always at least the size of the integer or + * larger. + * + * For base 2 this returns the exact bit-size of the integer. * ***/ size_t silc_mp_sizeinbase(SilcMPInt *mp, int base); @@ -167,6 +173,11 @@ void silc_mp_set_si(SilcMPInt *dst, SilcInt32 si); * Set `dst' integer from string `str' of base `base'. The `dst' must * already be initialized. * + * NOTES + * + * For base 2 the string must be in ASCII bit presentation, not in + * binary. Use the silc_mp_bin2mp to decode binary into integer. + * ***/ void silc_mp_set_str(SilcMPInt *dst, const char *str, int base); @@ -195,6 +206,11 @@ SilcUInt32 silc_mp_get_ui(SilcMPInt *mp); * must already have space allocated. The function returns the same * as `str' or NULL on error. * + * NOTES + * + * For base 2 the returned string is in ASCII bit presentation, not + * in binary. Use the silc_mp_mp2bin to encode integer into binary. + * ***/ char *silc_mp_get_str(char *str, SilcMPInt *mp, int base); -- 2.24.0