LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 04-15-2006, 01:23 AM   #1
anoosh
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).
thanks.
 
Old 04-15-2006, 02:45 AM   #2
primo
Member
 
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.

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


Reply



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 10:19 AM
How to convert a float to its binary or hex representation in Python? zero79 Linux - Software 1 08-29-2005 09:30 PM
[C++] char * to float Ossar Programming 2 08-03-2005 10:28 AM
count digits of a float || convert float to string nadroj Programming 6 07-11-2005 04:52 PM
How to use a float in a script. philipina Programming 4 03-18-2004 08:06 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:52 AM.

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