From 6735633663cdb39c95075f0f92f34c6d8f5c4ec6 Mon Sep 17 00:00:00 2001 From: akr Date: Mon, 10 Jun 2013 10:55:08 +0000 Subject: Update doc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- bignum.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/bignum.c b/bignum.c index 9e02361d91..4ac0d0675e 100644 --- a/bignum.c +++ b/bignum.c @@ -843,6 +843,9 @@ integer_pack_take_lowbits(int n, BDIGIT_DBL *ddp, int *numbits_in_dd_p) /* * Export an integer into a buffer. * + * This function fills the buffer specified by _words_ and _numwords_ as + * abs(val) in the format specified by _wordsize_, _nails_ and _flags_. + * * [val] Fixnum, Bignum or another integer like object which has to_int method. * [words] buffer to export abs(val). * [numwords] the size of given buffer as number of words. @@ -853,11 +856,13 @@ integer_pack_take_lowbits(int n, BDIGIT_DBL *ddp, int *numbits_in_dd_p) * It specifies word order and byte order. * * This function returns the signedness and overflow condition as follows: - * -2 : negative overflow. - * -1 : negative without overflow. - * 0 : zero. - * 1 : positive without overflow. - * 2 : positive overflow. + * -2 : negative overflow. val <= -2**(numwords*(wordsize*CHAR_BIT-nails)) + * -1 : negative without overflow. -2**(numwords*(wordsize*CHAR_BIT-nails)) < val < 0 + * 0 : zero. val == 0 + * 1 : positive without overflow. 0 < val < 2**(numwords*(wordsize*CHAR_BIT-nails)) + * 2 : positive overflow. 2**(numwords*(wordsize*CHAR_BIT-nails)) <= val + * + * The least significant words of abs(val) are filled in the buffer when overflow occur. */ int -- cgit v1.2.3