Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > Example of how to rb_class_new_instance(... rb_cBignum)?

Reply
Thread Tools

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

 
 
Clifford Heath
Guest
Posts: n/a
 
      03-03-2006
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.
 
Reply With Quote
 
 
 
 
Logan Capaldo
Guest
Posts: n/a
 
      03-03-2006

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()



 
Reply With Quote
 
 
 
 
Clifford Heath
Guest
Posts: n/a
 
      03-03-2006
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.
 
Reply With Quote
 
Daniel Harple
Guest
Posts: n/a
 
      03-03-2006

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


 
Reply With Quote
 
Logan Capaldo
Guest
Posts: n/a
 
      03-03-2006

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))



 
Reply With Quote
 
Clifford Heath
Guest
Posts: n/a
 
      03-03-2006
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.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Installer example in northwind or duwamish7? Bright ASP .Net 1 07-18-2005 05:50 PM
Shift register example? bob VHDL 1 02-18-2005 07:34 PM
'example.com' == 'example.com.' => false... is this intended? Sam Roberts Ruby 15 02-07-2005 04:36 PM
example designs for Xilinx System Generator ? Timo Dammes VHDL 2 06-11-2004 04:45 PM



Advertisments