Re: Blobs and IEEE floating point

2016-04-27 Thread Kevin Pye
Sorry to be so long replying and thanking you for your help -- I've spent most of the last week in hospital with very limited communications. Thank you -- lots of interesting information. I ended up for the moment with something like (retyping from memory)... method double { $!index += 8;

Re: Blobs and IEEE floating point

2016-04-20 Thread mt1957
On 19-04-16 10:21, Elizabeth Mattijsen wrote: FWIW, I’ll take PR’s for the PackUnpack distribution to make ‘f’ and ‘d’ work :-) Hi Elizabeth, For the PackUnpack distro this might come in handy... or might go in the examples corner? Done some experiments and looks well. Please check the

Re: Blobs and IEEE floating point

2016-04-19 Thread mt1957
Hi Timo, Thanks for the code snippets, I can use that too. There is already some code to test endianness see mail from David Warring at my question about Union. Date April 4 2016. Greetings, Marcel On 19/04/16 16:25, Elizabeth Mattijsen wrote: > I’ve been looking at nativecast, but

Re: Blobs and IEEE floating point

2016-04-19 Thread Timo Paulssen
On 19/04/16 16:25, Elizabeth Mattijsen wrote: I’ve been looking at nativecast, but haven’t been able to find an > example that I could apply to this? > Liz Right! I should have given a working example, or at least mention that CArray would probably be necessary to make this work.

Re: Blobs and IEEE floating point

2016-04-19 Thread Elizabeth Mattijsen
> On 19 Apr 2016, at 12:03, Timo Paulssen wrote: > > On 19/04/16 01:58, Kevin Pye wrote: >> […] >> 2. Write a simple C function to take a pointer to a double and return >> the double, put that into a shared library and then use NativeCall. > >> […] > > > Fortunately, you

Re: Blobs and IEEE floating point

2016-04-19 Thread Timo Paulssen
On 19/04/16 01:58, Kevin Pye wrote: […] > 2. Write a simple C function to take a pointer to a double and return > the double, put that into a shared library and then use NativeCall. > […] Fortunately, you don't have to use a library with a custom function. You can just use "nativecast" for

Re: Blobs and IEEE floating point

2016-04-19 Thread Elizabeth Mattijsen
FWIW, I’ll take PR’s for the PackUnpack distribution to make ‘f’ and ‘d’ work :-) > On 19 Apr 2016, at 07:28, JuhiMarcel LangbroekTimmerman > wrote: > > Hi Kevin > > I've made something up for the time being. You can find it in the BSON > module. Look for the file

Re: Blobs and IEEE floating point

2016-04-19 Thread JuhiMarcel LangbroekTimmerman
Hi Kevin I've made something up for the time being. You can find it in the BSON module. Look for the file lib/Document.pm6 and the subs encode-double and decode-double. This code must be rewritten though for speed but at least it works. Marcel P.s. I've seen that not all comments in the

Blobs and IEEE floating point

2016-04-18 Thread Kevin Pye
Hi, I have a several-thousand-line long Perl 5 script which I've been translating to Perl 6 over some time, and it runs fine, although a little slowly :-) There is however one section which I haven't needed to use until recently, and which I've been avoiding translating because it's not all that