Encyclopedia > Real data type

  Article Content

Real data type

A real data type is a data type used in a computer program to represent an approximation of a real number. Because the real numbers are not countable, computers cannot represent them exactly using a finite amount of information. Most often, a computer will use a rational approximation to a real number.

Rational numbers

The most general data type for a rational number stores the numerator and denominator as integers. See integral data type.

Fixed point numbers

A "fixed point" data type assumes a specific denominator for all numbers. The denominator here is most often a power of two. For example, in a system whose denominator is 65,536 (216), the hexadecimal number 0x12345678 means 0x12345678/65536 or 305419896/65536 or 4660 + 22136/65536 or about 4660.33777. See fixed point.

Floating point numbers

A "floating point" type is a compromise between the flexibility of a general rational type and the speed of fixed-point arithmetic. It uses some of the bits in the data type to specify a power of two for the denominator. See floating point and IEEE Floating Point Standard.



All Wikipedia text is available under the terms of the GNU Free Documentation License

 
  Search Encyclopedia

Search over one million articles, find something about almost anything!
 
 
  
  Featured Article
Kings Park, New York

... makeup of the town is 95.45% White, 0.84% African American, 0.13% Native American, 1.89% Asian, 0.03% Pacific Islander, 0.62% from other races, and 1.04% from two or ...

 
 
 
This page was created in 37.4 ms