[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Read ieee-754-2008 four-byte floating-point number from binary file?
- From: Peter Cawley <lua@...>
- Date: Mon, 12 Apr 2010 01:12:55 +0100
On Mon, Apr 12, 2010 at 12:59 AM, <maxxedout@comcast.net> wrote:
> Well, since this Lua code is going to be a plugin for an existing C
> application, it shouldn't be too hard to do this specific function in
> C if I really need to. I just hoped to avoid it.
There is Lua code floating around to convert a string containing 4
bytes representing an IEEE 754 float into a number, using just the Lua
standard library. That said, the code is complicated, fragile, and
probably fails on many edge cases. Hence if you have the option to do
it in C, then I'd recommend doing it in C.