Pelles C forum

C language => Beginner questions => Topic started by: leandrojardim on October 04, 2012, 05:09:31 AM

Title: How do I extract the coefficient and exponent with operators
Post by: leandrojardim on October 04, 2012, 05:09:31 AM
How do I extract the coefficient and exponent of a float variable with operators? I tried a simple float variable, by converting it to a unsigned integer and trying to use every possible combination of operators and bitmasks, using as a guide the article on Wikipedia, but it doesnt work.... :(
Title: Re: How do I extract the coefficient and exponent with operators
Post by: czerny on October 04, 2012, 08:11:10 AM
Show us your not working source, please! We than will see what is wrong.
Title: Re: How do I extract the coefficient and exponent with operators
Post by: CommonTater on October 04, 2012, 09:17:35 AM
A link to the Wikipedia article might also help...
Title: Re: How do I extract the coefficient and exponent with operators
Post by: TimoVJL on October 04, 2012, 01:48:59 PM
Maybe this page:
http://en.wikipedia.org/wiki/Single-precision_floating-point_format
Title: Re: How do I extract the coefficient and exponent with operators
Post by: leandrojardim on October 14, 2012, 12:32:59 AM
Thanks timovjl, this page should be all that I need up to now. I was using the pages bout "floating point" and "fixed point", but I lost the page you pointed. Thanks!