Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
HP-UX Floating-Point Guide: HP 9000 Computers > Chapter 1 Introduction

Overview of Floating-Point Principles

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Glossary

 » Index

In the context of computer programming, the term floating-point refers to the ways in which modern computer systems represent real numbers and perform real arithmetic. Computers use special representations for ­floating-point numbers. They also have special rules for performing ­floating-point arithmetic that differ from the rules for performing integer arithmetic. Usually, a computer has special hardware for performing ­floating-point calculations at a higher speed than would be possible using the computer's integer-oriented hardware.

In all modern computer systems, representations of real numbers are inherently inexact. There are an infinite number of real numbers, and a digital computer can represent only a finite subset of them.

When you write a program that attempts to generate an unrepresentable value, the computer approximates the value by choosing a representable value close to the one you attempted to generate. Data that is input into a computer in floating-point format is almost always approximate, and the calculations performed by the computer are usually approximations of the intended mathematical operations; therefore, the results you receive from a mathematical computation are also usually approximations.

The approximate nature of floating-point arithmetic has several important ramifications:

  • Results from floating-point calculations are almost never exactly equal to the corresponding mathematical value.

  • Results from a particular calculation may vary slightly from one computer system to another, and all may be valid. However, when the computer systems conform to the same standard, the amount of variation is drastically reduced.

  • Incorrect results are not necessarily caused by programming errors in the traditional sense. Correcting the problems may require an understanding of the ­floating-point approximation techniques used by the computer system executing the program.

The types of incorrect results and unexpected errors that floating-point applications sometimes generate can be very difficult to interpret if you do not understand how your computer performs floating-point arithmetic. The purpose of this book is to help you avoid or fix these types of problems on HP 9000 computer systems and to help you increase the performance of your floating-point-intensive applications.

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© 1997 Hewlett-Packard Development Company, L.P.