Did you know LQ has a Linux Hardware Compatibility List?
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 04-15-2006, 02:23 AM   #1
LQ Newbie
Registered: Aug 2004
Location: IRAN
Posts: 7

Rep: Reputation: 0
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).
Old 04-15-2006, 03:45 AM   #2
Registered: Jun 2005
Posts: 542

Rep: Reputation: 34
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.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to convert a float to its binary or hex representation in Python? zero79 Programming 1 09-01-2005 11:19 AM
How to convert a float to its binary or hex representation in Python? zero79 Linux - Software 1 08-29-2005 10:30 PM
[C++] char * to float Ossar Programming 2 08-03-2005 11:28 AM
count digits of a float || convert float to string nadroj Programming 6 07-11-2005 05:52 PM
How to use a float in a script. philipina Programming 4 03-18-2004 09:06 AM

All times are GMT -5. The time now is 02:55 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration