lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 11 April 2010 19:43,  <maxxedout@comcast.net> wrote:
> I'm reading some files in an existing binary format, which include 4-byte floating-point numbers. I have the file's contents loaded into a string. I need a function which will parse one floating-point number from the string, given the index of the first byte. Does Lua's library provide this? Or should I throw something together with the bitop library?
>
> This is using Lua 5.1.4.

I faced this problem a while ago when trying to decode some doubles in
OSC. It was pretty surprising to hit such a brick wall, I'm thinking
the easiest way would be either bitops or a proper pointer cast in C.

    henk