[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: IEEE-754 encode/decode
- From: Clark Snowdall <snowdall@...>
- Date: Sat, 27 Mar 2010 22:04:44 -0700
I'm a newbie here so be gentle ...
I need to convert back and forth between a string of bytes (4 bytes, 32-bits), and IEEE-754 floating point. Basically I need to read a byte stream from a network socket and convert those bytes to a number.
For example I need to convert:
x = string.char(0x42, 0x96, 0x00, 0x00)
y = 74.0
And vice versa. I understand the IEEE-754 standard and if pressed could probably muddle through writing something from scratch. But as with any programmer, if someone's already done it or if it's already in the language somewhere, it would just be easier than reinventing the wheel.
Any ideas folks?
Description: S/MIME cryptographic signature