| | |
Irrational number data type
Please support our Computer Science advertiser: Learn about neural networks and artificial intelligence.
![]() |
Hello everyone. I am planning to write a program, part of which will be able to calculate the value of an irrational number to an unlimited number of places. I will probably use a C++ class to implement a custom array to store these numbers. However, I need to know a couple of things about floating point values first:
1. If you have declared a standard "float" type variable in C and initialised it with a value, how do you know how many bits have been used for the exponent and how many for the modulus?
2. If you store 0.8743 (for example) in a float, are the four decimal digits after the point stored in the modulus in decimal form i.e.:
1000 0111 0100 0011
--8-----7-----4-----3---
Or is some other system used? Any answers would be appriciated.
Steven.
1. If you have declared a standard "float" type variable in C and initialised it with a value, how do you know how many bits have been used for the exponent and how many for the modulus?
2. If you store 0.8743 (for example) in a float, are the four decimal digits after the point stored in the modulus in decimal form i.e.:
1000 0111 0100 0011
--8-----7-----4-----3---
Or is some other system used? Any answers would be appriciated.
Steven.
Last edited by Mushy-pea; Sep 29th, 2006 at 8:40 am. Reason: Mistakes.
The one question you should not ask when teaching a new language structure is "Do you understand?". Do you understand?
See http://en.wikipedia.org/wiki/IEEE_754 for information on how float and double are typically implemented.
All my posts may be redistributed under the GNU Free Documentation License.
![]() |
Similar Threads
- MS SQL data type length (MS SQL)
- C++: problam with data type(int,float,double) (C++)
- Working with SQL server's Image data type (ASP.NET)
- why is double data type giving an garbage value (Java)
- Problems with changing values returned by RegQueryValueEx (C)
- help on data type conversion (Visual Basic 4 / 5 / 6)
- Working with SQL's Text data type (ASP.NET)
- Text data type troubles in T-SQL (Database Design)
Other Threads in the Computer Science Forum
- Previous Thread: The science of the CRASH....
- Next Thread: help me(cpu scheduling)
Views: 1318 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for Computer Science
ai algorithm algorithms amazon assignment assignmenthelp assignments automata battery binary bittorrent bizarre bletchleypark blogging bomb business cern codebreaker compiler computers computerscience computertrackingsoftware connect csc data dataanalysis dataintepretation development dissertation dissertations dissertationthesis dissertationtopic ebook employment energy extensions floatingpoint foreclosure foreclosuresoftware gadgets geeks givemetehcodez graphics hardware history homeowners homework homeworkassignment homeworkhelp humor ibm idea internet iphone ipod itcontracts laws lazy linkbait lsmeans mainframes marketing mining mobileapplication msaccess nano networking news os p2p parser piracy piratebay principles programming rasterizer sam-being-cute sas science sex simulation software spoonfeeding spying sql stephenfry student study supercomputer supercomputing sweden technology textfield tree turing turingtest uk virus warehouse ww2






