John
John

Reputation: 16007

Any C++ libraries available to convert between floating point representations?

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.

Upvotes: 2

Views: 1672

Answers (2)

John
John

Reputation: 16007

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

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

Upvotes: 1

Mike G.
Mike G.

Reputation: 1690

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.

Upvotes: 3

Related Questions