ruby fixnums

  • Thread starter Elias Athanasopoulos
  • Start date
E

Elias Athanasopoulos

Hello!

As I have understood Ruby fixnums are passed by value and
you can grab the value as an integer like:

VALUE foo;
int i = (int) (foo >> 1);

Is there any way to get an explicit reference of the
value of the fixnum in C, without allocating new space, or using
a new integer pointer?

I.e. what &RFLOAT(foo)->value does.

Regards,
 
E

Elias Athanasopoulos

So the short answer is no, there's no way to change the value of a
Fixnum object like you could with a Float, even from C code. A Fixnum is
what it is.

Thanks for the detailed reply.

Regards,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,142
Messages
2,570,820
Members
47,367
Latest member
mahdiharooniir

Latest Threads

Top