Binary file - numbers

B

Bertrand Mollinier Toublet

Blah said:
Well that attempt at a joke went quite sour.

My rant's foundation is in misunderstanding. My apologies for
unwittingly putting words in your mouth.

Between one sig referencing TX and another referencing the 4th largest
US city, I assumed you actually meant Houston. Oh well. That'll teach me
not to make dumb jokes.
Last time I tried to make a dumb joke implying Martin Ambuhl, it turned
quite sour as well... I guess that's how one learns...

http://groups.google.com/[email protected]
 
D

Dhruv

I have a binary file that I want to read some numbers out of. However
the numbers are 32bit floats. How can I get the numbers into a C
program to use? I can do the calculations manually....but is there an
easier way? Is there some handy functions which do this?

example.

File contains: 42 7C 00 00
I want to read it in and end up with my C variable equalling 63.


If your program stored them in the standard IEEE floating point format,
then you could find out which bits represents what (number, sign,
exponent), and rotate the appropriate bits, and get the equivalent 16-bit
float. You would have been better off storing the number as ASCII text, if you
were worried about portability.

-Dhruv.
 
M

Mark McIntyre

In fact C and C++ is just a fucking shit of programming lge, arg i hate it
with my heart.
I love JAVA, although

I'm happy for you. Why are you wasting our bandwidth in CLC then?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,075
Messages
2,570,562
Members
47,197
Latest member
NDTShavonn

Latest Threads

Top