From: Mathieu Bouchard Date: 2006-07-24T01:19:37+09:00 Subject: Re: [YAY] my sandboxing extension!! --8323328-936354693-1153671519=:30944 Content-Type: MULTIPART/MIXED; BOUNDARY="8323328-936354693-1153671519=:30944" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323328-936354693-1153671519=:30944 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE On Thu, 20 Jul 2006, Nikolai Weibull wrote: > Also, why is there no way of creating a Bignum, e.g., rb_big_new()? do this: VALUE foo =3D rb_funcall((VALUE)3,rb_intern("<<"),INT2NUM(n)); where n is the floor of the base 2 log of your number. this will make foo= =20 the largest power of two smaller or equal to your number (which is the=20 number of base 2 digits in your number). Then edit the contents of the=20 bignum using ((BDIGIT *)((RBignum*)foo)->digits)[i]=3Dx; it's in little-endian between BDIGIT chunks, and in machine-order inside=20 each BDIGIT chunk. _ _ __ ___ _____ ________ _____________ _____________________ ... | Mathieu Bouchard - t=E9l:+1.514.383.3801 - http://artengine.ca/matju | Freelance Digital Arts Engineer, Montr=E9al QC Canada --8323328-936354693-1153671519=:30944-- --8323328-936354693-1153671519=:30944--