Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Convert String to float problem

807591May 2 2008 — edited May 2 2008
Hi,
I have the following problem:
I have converted a float value into binnary:

String a1;
a1=Integer.toBinaryString(Float.floatToRawIntBits(nr1));

Now the variable a1 looks like that(for input -1.222) a1=10111111100111000110101001111111

My problem is that i can't convert this value from string to int(out of range),float(make my number looks like that:1.1000002E31). I need the number stay the same structure because I want to extract some bits.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 30 2008
Added on May 2 2008
10 comments
756 views