Hey
Anybody thought to use an union in C/C++? Entering the chars and check what's in the float?
union s_float
{
char c[4];
float f;
}
Floating
-
- Posts: 106
- Joined: Thu Oct 29, 2009 9:21 pm
Yeah you might be right.
Well, as for me, I tried googling and all that. I ended up at wikipedia trying to do it by hand, etc.
5 min passed before I said to myself, that's it, I write a little union program. And it took me less than a minute.
But I understand, finding the right website right away seems kinda cool! And doesn't sound too hard. I'm just a noob.
Well, as for me, I tried googling and all that. I ended up at wikipedia trying to do it by hand, etc.
5 min passed before I said to myself, that's it, I write a little union program. And it took me less than a minute.
But I understand, finding the right website right away seems kinda cool! And doesn't sound too hard. I'm just a noob.
This site offers a neat conversion utility: http://www.h-schmidt.net/FloatApplet/IEEE754.html.
Yeah, I guess that was the web site (it's been some time, my memory is not very clear anymore).
I was begging to find such a "cool" web site for the Cobol floating point challenge, but I was not lucky that time.
My C knowledge is a bit outdated (15 years), so I hope it's allowed to use current ways of information first
And remember: You're no noob if you solved a challenge. The result is important, not the way you achieved it...
I was begging to find such a "cool" web site for the Cobol floating point challenge, but I was not lucky that time.
My C knowledge is a bit outdated (15 years), so I hope it's allowed to use current ways of information first
And remember: You're no noob if you solved a challenge. The result is important, not the way you achieved it...