Forum: Ruby A 64bit question?

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
David S. (Guest)
on 2009-03-31 15:31
I have been trying to implement the music sequencer in the mac
frameworks library. Most of the calls seem to work with the exception of
those that use the "MusicTimeStamp" type. This I think should be cast as
a double or float64. Most of the literature I have read seems to suggest
that Ruby can't fake one of these numbers when calling an external
library. In which case should I look into wrapping the C functions
externally and do the typecasting myself?
David S. (Guest)
on 2009-04-02 14:46
David Sibley wrote:
> I have been trying to implement the music sequencer in the mac
> frameworks library. Most of the calls seem to work with the exception of
> those that use the "MusicTimeStamp" type. This I think should be cast as
> a double or float64. Most of the literature I have read seems to suggest
> that Ruby can't fake one of these numbers when calling an external
> library. In which case should I look into wrapping the C functions
> externally and do the typecasting myself?

just solved the problem by declaring a struct

        TypeCaster = struct [
            "MusicTimeStamp n",
            ]

then passing num.n below

        num = 'module name'::TypeCaster.malloc()
        num.n = 0.34
This topic is locked and can not be replied to.