# A 64bit question?

**URL:** <https://www.ruby-forum.com/t/a-64bit-question/164355>\
**Category:** Ruby\
**Created:** [March 31, 2009, 1:31pm UTC](https://www.ruby-forum.com/t/a-64bit-question/164355 "2009-03-31T13:31:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![davidstokar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Post date:** [March 31, 2009, 1:31pm UTC](https://www.ruby-forum.com/t/a-64bit-question/164355/1 "2009-03-31T13:31:41Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![davidstokar](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/4da419/32.png) [@davidstokar](https://www.ruby-forum.com/u/davidstokar)\
**Post date:** [April 2, 2009, 12:46pm UTC](https://www.ruby-forum.com/t/a-64bit-question/164355/2 "2009-04-02T12:46:12Z")

</div>

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