任何可用于在浮点表示之间转换的C ++库? [英] Any C++ libraries available to convert between floating point representations?
问题描述
我最近需要解释一个DEC 32位浮点表示。它不同于分配给指数和尾数的位数的IEEE浮点表示。
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
我设法滚动我自己的C ++代码,将一个DEC 32位浮点数填入IEEE 32位浮点数,但是想知道是否
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.
我选中了 boost.org ,但没有看到任何内容。
I checked boost.org but didn't see any in there.
推荐答案
http://pubs.usgs.gov/of/2005/1424/ =nofollowtitle =libvaxdata> libvaxdata ?
You mean like libvaxdata?
我从来没有使用它 - 我只是发现它通过谷歌。但它看起来像你要找的。
I've never used it - I just found it by googling. But it looks like what you're looking for.
这是一个C库,而不是C ++,但是转换浮点数据应该在externC调用中正常工作。
It's a C library rather than C++, but converting floating point data should work fine from extern "C" calls.
这篇关于任何可用于在浮点表示之间转换的C ++库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!