PDA

View Full Version : IEEE-754 <-> Decimal in C



rublind
03-06-2007, 06:01 PM
Does anyone know a place that has source code for something like this?

It is a pain in the ass to write, and I couldn't get it to work.

lynx
03-06-2007, 09:54 PM
http://babbage.cs.qc.edu/IEEE-754/32bit.html

This page has javascript code which does what you need.

If you view the page source you should be able to extract the relevant portions and conversion to C should be relatively simple.

rublind
03-06-2007, 11:31 PM
Oh yeah, I looked at the JS source, and wanted to kill myself. I was hoping someone had it done already in C. But thanks. =]