Article Preview
Buy Now
| Print: | |
| PDF: |
Feature
The Problem with Floating-Point Numbers, Part II
Encoding real numbers into integer format
Issue: 4.1 (September/October 2005)
Author: William H. Murray and Chris H. Pappas
Article Description: No description available.
Article Length (in bytes): 15,395
Starting Page Number: 24
RBD Number: 4111
Resource File(s):
4111.sit Updated: Monday, September 19, 2005 at 12:20 PM
Related Link(s): None
Known Limitations: None
Excerpt of article text...
In the last issue of REALbasic Developer, we discussed a number of problems related to passing real numbers across an "integer" data bus. In the first article, you learned that while generations of computers have allowed both integer and real number arithmetic, dealing with real numbers is not a simple issue. However, don't take our word for it; go back and review this first article and learn about the various problems programmers have had to deal with for decades.
Recall that by the mid-80's, the American National Standards Institute (ANSI) and the Institute for Electrical and Electronic Engineers (IEEE) released the ANSI/IEEE 754 floating-point standard addressing many of these conversion problems. They also provided the means of converting, or encoding, real numbers into an integer format that could be passed across the data bus and also a means of converting those encoded integer formats back to real numbers by a decoding process.
In the first article, we developed a REALbasic program that allows us to enter an encoded integer number (in short, long or temporary format) then convert it to a normal real number format. In this article, we're going to do the reverse. That is, we'll start with a real number, apply a conversion process and end up with an encoded real number in integer format. Once we understand the process, we'll develop a REALbasic program that will perform the conversion for us.
...End of Excerpt. Please purchase the magazine to read the full article.
Article copyrighted by REALbasic Developer magazine. All rights reserved.
|











