| | |
Binary
Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
![]() |
•
•
Join Date: Jun 2009
Posts: 2
Reputation:
Solved Threads: 0
Sorry in advance if this is in the wrong forums but I am new here and was not too sure where to post for help. Onto business I was wondering if anybody knows how to convert a number that has a decimal point in it (example: 0.31) into binary? I have been tasked to do it but everywhere I look is no help and was wondering if anybody here could shed some light onto this?
Thanks in advance,
Steve.
Thanks in advance,
Steve.
You are talking about floating point.
Dependent upon the data format typically IEEE
32-bit SPFP Single-Precision Floating-Point
64-bit DPFP Double-Precision Floating-Point
80-bit Double-Extended Precision Floating-Point
there are three components.
A sign bit, typically the MSB.
The Exponent
and
the Mantissa.
So 1.0 in 32-bit using IEEE would be
0x3f800000
-1.0
0xbf800000
32-bit SPFP
Sign:{31} Exponent:{30...23} mantissa:{22...0}
64-bit DPFP
63 62...52 51....0
80-bit
79 78...64 62....0
There's an implied (1) bit at bit 63.
Dependent upon the data format typically IEEE
32-bit SPFP Single-Precision Floating-Point
64-bit DPFP Double-Precision Floating-Point
80-bit Double-Extended Precision Floating-Point
there are three components.
A sign bit, typically the MSB.
The Exponent
and
the Mantissa.
So 1.0 in 32-bit using IEEE would be
0x3f800000
-1.0
0xbf800000
32-bit SPFP
Sign:{31} Exponent:{30...23} mantissa:{22...0}
64-bit DPFP
63 62...52 51....0
80-bit
79 78...64 62....0
There's an implied (1) bit at bit 63.
![]() |
Similar Threads
- Recursive binary search (C)
- a simple way to print a binary representation of a floating point number? (C++)
- coding a complete binary tree with Dev-C++ (C++)
- decimal > binary > Oct > Hex (C++)
- binary file (C)
- ASCII to BINARY, & VICA VERCA (C++)
Other Threads in the Computer Science Forum
- Previous Thread: creative graduation project ideas needed
- Next Thread: shrink wrapped applications
| Thread Tools | Search this Thread |
ai algorithm algorithms amazon assignment assignmenthelp assignments automata battery bigbrother binary bittorrent bletchleypark bomb business cern codebreaker compiler computer computerscience computertrackingsoftware connect conversion csc dataanalysis dataintepretation development dfa dissertation dissertations dissertationthesis dissertationtopic ebook employment energy floatingpoint foreclosure foreclosuresoftware fuel gadgets geeks givemetehcodez government graphics hardware history homeowners homeworkassignment homeworkhelp humor ibm idea internet iphone ipod itcontracts jobs kindle laser laws lsmeans mainframes marketing mobileapplication msaccess nano netbeans networking news os p2p piracy piratebay principles rasterizer research sam-being-cute sas science software spying stephenfry study supercomputer sweden technology textfield turing turingtest two'scompliment uk virus ww2





