[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Example of how to rb_class_new_instance(... rb_cBignum)?

Clifford Heath

3/3/2006 12:58:00 AM

I'm building a C extension and have a "long long"
which I want to turn into a Bignum. Can anyone
point me to an example please? I've googled without
success.

Clifford Heath.
5 Answers

Logan Capaldo

3/3/2006 1:08:00 AM

0


On Mar 2, 2006, at 7:58 PM, Clifford Heath wrote:

> I'm building a C extension and have a "long long"
> which I want to turn into a Bignum. Can anyone
> point me to an example please? I've googled without
> success.
>
> Clifford Heath.
>

Basing this purely on a random guess (based on reasonable assumptions
about ruby) try:
LONGLONG2NUM()



Clifford Heath

3/3/2006 1:16:00 AM

0

Logan Capaldo wrote:
> Basing this purely on a random guess (based on reasonable assumptions
> about ruby) try:
> LONGLONG2NUM()

Reasonable guess I suppose, except that doesn't seem to
be declared anywhere (ruby 1.8.1-11) :-(.

Clifford.

Daniel Harple

3/3/2006 1:16:00 AM

0


On Mar 3, 2006, at 1:58 AM, Clifford Heath wrote:

> I'm building a C extension and have a "long long"
> which I want to turn into a Bignum. Can anyone
> point me to an example please? I've googled without
> success.
>
> Clifford Heath.

VALUE foo = LL2NUM(my_long);

-- Daniel


Logan Capaldo

3/3/2006 1:40:00 AM

0


On Mar 2, 2006, at 8:18 PM, Clifford Heath wrote:

> Logan Capaldo wrote:
>> Basing this purely on a random guess (based on reasonable
>> assumptions about ruby) try:
>> LONGLONG2NUM()
>
> Reasonable guess I suppose, except that doesn't seem to
> be declared anywhere (ruby 1.8.1-11) :-(.
>
> Clifford.
>

Hopefully by now you've seen Daniel's more accurate response. (LL2NUM
(x))



Clifford Heath

3/3/2006 4:30:00 AM

0

Daniel Harple wrote:
> VALUE foo = LL2NUM(my_long);

Thanks both. I have my extension working.

Kudos to Matz also - it's really easy to build these things :-).

Clifford Heath.