views:

551

answers:

2

I recently had a need to interpret a DEC 32-bit floating point representation. It differs from the IEEE floating point representations in the number of bits allocated to the exponent and mantissa.

Here's a description of a bunch of floating point formats:

http://www.quadibloc.com/comp/cp0201.htm

I managed to roll my own C++ code to stuff a DEC 32-bit float into an IEEE 32-bit float but was wondering if there were any libraries out there that had tackled this conversion and others already.

I checked boost.org but didn't see any in there.

+2  A: 

You mean like libvaxdata?

I've never used it - I just found it by googling. But it looks like what you're looking for.

It's a C library rather than C++, but converting floating point data should work fine from extern "C" calls.

Mike G.
+1  A: 

Ha ... not sure why I didn't check Code Project:

http://www.codeproject.com/KB/applications/libnumber.aspx

John at CashCommons