mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
add comment.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26818 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
6bec06674c
commit
ef7d0431a0
1 changed files with 14 additions and 0 deletions
14
bignum.c
14
bignum.c
|
@ -308,6 +308,19 @@ rb_int2inum(SIGNED_VALUE n)
|
|||
# error unexpected SIZEOF_LONG : SIZEOF_BDIGITS ratio
|
||||
#endif
|
||||
|
||||
/*
|
||||
* buf is an array of long integers.
|
||||
* buf is ordered from least significant word to most significant word.
|
||||
* buf[0] is the least significant word and
|
||||
* buf[num_longs-1] is the most significant word.
|
||||
* This means words in buf is little endian.
|
||||
* However each word in buf is native endian.
|
||||
* (buf[i]&1) is the least significant bit and
|
||||
* (buf[i]&(1<<(SIZEOF_LONG*CHAR_BIT-1))) is the most significant bit
|
||||
* for each 0 <= i < num_longs.
|
||||
* So buf is little endian at whole on a little endian machine.
|
||||
* But buf is mixed endian on a big endian machine.
|
||||
*/
|
||||
void
|
||||
rb_big_pack(VALUE val, unsigned long *buf, long num_longs)
|
||||
{
|
||||
|
@ -349,6 +362,7 @@ rb_big_pack(VALUE val, unsigned long *buf, long num_longs)
|
|||
}
|
||||
}
|
||||
|
||||
/* See rb_big_pack comment for endianness of buf. */
|
||||
VALUE
|
||||
rb_big_unpack(unsigned long *buf, long num_longs)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue