LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   float to binary (https://www.linuxquestions.org/questions/programming-9/float-to-binary-435330/)

anoosh 04-15-2006 01:23 AM

float to binary
 
please tell me
how may I convert a decimal mantissa to binary?
what is the algorithm?
after explaining the algorithm please give me an example with 0.01(show me how you convert it to binary).
thanks.

primo 04-15-2006 02:45 AM

Homework questions.

See <ieee754.h>
Declare a variable to be either "union ieee754_float" or "union ieee754_double", assign any value to it through any of the "f" or "d" union member so you may retrieve the individual bits.

See http://babbage.cs.qc.edu/courses/cs341/IEEE-754.html


All times are GMT -5. The time now is 08:49 PM.