Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

show floating point binary

Status
Not open for further replies.

Gupp

Electrical
Joined
Dec 17, 2005
Messages
1
Location
AU
I'm doing some work in Matlab that requires the analysis (and modification) of numbers on a bit level.
I want to convert numbers like this: -0.00300634
into it's double-precision floating point binary representation (1 bit sign, 11 bit exponent, 52 bit mantissa) so I can perform hamming distance calculations as well as modify certain bits in the sequence. I know that Matlab stores and performs arithmetic on numbers in this format so I was wondering if there exists functions that allow this sort of thing to be done.
 
If you are running v7.1, try the new typecast() function.

>> format hex
>> typecast(-0.00300634,'uint64')

ans =

bf68a0c07f618a09

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top