Position of point in mantissa -
i trying understand how java works floating point. understand there must sign,exponent , mantissa in 32 bits (float). however, can't understand how java defines decimal part in mantissa. understand mantissa can 0,....
till 9,......
the question how java defines position of point. explain?
java doesn't define how float
works, ieee does.
float
binary format possible range of 24-bit mantissa normal numbers
0b1.0000 0000 0000 0000 0000 0000
to
0b1.1111 1111 1111 1111 1111 1111
this represents 1.0
2.0 - 1/2^24
for normal numbers mantissa starts 1
not stored. because values
sign * 2^exp * mantissa.
the exp adjusted mantissa starts 1.
there sub-normal numbers don't this, applies small numbers.
if want see how float represented can have at
int = float.floattorawintbits(1.5);
the i
have 32-bit value represents float
Comments
Post a Comment