I am looking for a reference implementation of IEEE-754 operations. Is there such a thing?
相关问题
- Sorting 3 numbers without branching [closed]
- How to compile C++ code in GDB?
- Why does const allow implicit conversion of refere
- thread_local variables initialization
- What uses more memory in c++? An 2 ints or 2 funct
相关文章
- How can I convert a f64 to f32 and get the closest
- Class layout in C++: Why are members sometimes ord
- How to mock methods return object with deleted cop
- Which is the best way to multiply a large and spar
- C++ default constructor does not initialize pointe
- Selecting only the first few characters in a strin
- What exactly do pointers store? (C++)
- Converting glm::lookat matrix to quaternion and ba
I believe the C libraries SoftFloat and fdlibm are suitable for what you are looking for. Others include Linux (GNU libc, glibc) or *BSD libc's math functions. Finally, CRlibm should also be of interest to you.
Ulrich Drepper has a interesting look at different math libraries, that might be also worth reading through.
one work around for you could python. python has a function that can convert IEEE-754 32/64 bit precision HEX float point
You can either write you app in python or just create a python function and call it in C/C++
I'm unsure how to call python from C/C++ but it is possible. Calling Python functions from C++
I must disappoint you: There is practically none.
While technically there are IEEE-754 compliant systems because they do not implement non-required features described in the standard, a reference implementation allowing
does not exist in the standard languages. This causes recurring woes of William Kahan, the main force behind the standard and its adaption on the Intel processors.
I don't know if there are some esoteric languages which do support them, but I can rule out Java, C#, C++, Fortran.
EDIT: While there is a lack of compiler support, I advise Hausers SoftFloat implementation given by mctylr. Hauser knows what he is doing.
http://portal.acm.org/citation.cfm?id=227699.227701&coll=portal&dl=ACM&CFID=77938829&CFTOKEN=18578907
A rather confusing question; in C++ it is assumed this sort of detail is taken care of by the hardware or the compiler. So, in C++ floating-point addition would be
I'm sure this is not what you actually meant; perhaps you'd benefit from this page which tries to emulate IEEE-754-compliant hardware in javascript?