Builders of computer systems often need information about floating-point arithmetic. There are, however, remarkably few sources of detailed information about it. One of the few books on the subject, Floating-Point Computation by Pat Sterbenz, is long out of print. This paper is a tutorial on those aspects of floating-point arithmetic (floating-point hereafter) that have a direct connection to systems building. It consists of three loosely connected parts. The first Section, "Rounding Error," on page 173, discusses the implications of using different rounding strategies for the basic operations of addition, subtraction, multiplication and division. It also contains background information on the two methods of measuring rounding error, ulps and relative error. The second part discuses the IEEE floating-point standard, which is becoming rapidly accepted by commercial hardware manufacturers. Included in the IEEE standard is the rounding method for basic operations. The discussion of the standard draws on the material in the Section , "Rounding Error," on page 173. The third part discusses the onnections between floating-point and the design of various aspects of computer systems. Topics include instruction set design, optimizing compilers and exception handling.
I have tried to avoid making statements about floating-point without also giving reasons why the statements are true, especially since the justifications involve nothing more complicated than elementary calculus. Those explanations that are not central to the main argument have been grouped into a section called "The Details," so that they can be skipped if desired. In particular, the proofs of many of the theorems appear in this section. The end of each proof is marked with the * symbol; when a proof is not included, the * appears immediately following the statement of the theorem.
Squeezing infinitely many real numbers into a finite number of bits requires an approximate representation. Although there are infinitely many integers, in most programs the result of integer computations can be stored in 32 bits. In contrast, given any fixed number of bits, most calculations with real numbers will produce quantities that cannot be exactly represented using that many bits. Therefore the result of a floating-point calculation must often be rounded in order to fit back into its finite representation. This rounding error is the characteristic feature of floating-point computation. "Relative Error and Ulps" on page 176 describes how it is measured.
Since most floating-point calculations have rounding error anyway, does it matter if the basic arithmetic operations introduce a little bit more rounding error than necessary? That question is a main theme throughout this section. "Guard Digits" on page 178 discusses guard digits, a means of reducing the error when subtracting two nearby numbers. Guard digits were considered sufficiently important by IBM that in 1968 it added a guard digit to the double precision format in the System/360 architecture (single precision already had a guard digit), and retrofitted all existing machines in the field. Two examples are given to illustrate the utility of guard digits.
The IEEE standard goes further than just requiring the use of a guard digit. It gives an algorithm for addition, subtraction, multiplication, division and square root, and requires that implementations produce the same result as that algorithm. Thus, when a program is moved from one machine to another, the results of the basic operations will be the same in every bit if both machines support the IEEE standard. This greatly simplifies the porting of programs. Other uses of this precise specification are given in "Exactly Rounded Operations" on page 185.
Tyrannosaurus rex was one of the largest land carnivores of all time; the largest complete specimen, FMNH PR2081 ("Sue"), measured 12.8 metres (42 ft) long, and was 4.0 metres (13 ft) tall at the hips. Mass estimates have varied widely over the years, from more than 7.2 metric tons (7.9 short tons), to less than 4.5 metric tons (5.0 short tons), with most modern estimates ranging between 5.4 and 6.8 metric tons (6.0 and 7.5 short tons). Although Tyrannosaurus rex was larger than the well known Jurassic theropod Allosaurus, it was slightly smaller than Cretaceous carnivores Spinosaurus and Giganotosaurus.
The neck of T. rex formed a natural S-shaped curve like that of other theropods, but was short and muscular to support the massive head. The forelimbs had only two clawed fingers, along with an additional small metacarpal representing the remnant of a third digit. In contrast the hind limbs were among the longest in proportion to body size of any theropod. The tail was heavy and long, sometimes containing over forty vertebrae, in order to balance the massive head and torso. To compensate for the immense bulk of the animal, many bones throughout the skeleton were hollow, reducing its weight without significant loss of strength.
The largest known T. rex skulls measure up to 5 feet (1.5 m) in length. Large fenestrae (openings) in the skull reduced weight and provided areas for muscle attachment, as in all carnivorous theropods. But in other respects Tyrannosaurus’ skull was significantly different from those of large non-tyrannosauroid theropods. It was extremely wide at the rear but had a narrow snout, allowing unusually good binocular vision. The skull bones were massive and the nasals and some other bones were fused, preventing movement between them; but many were pneumatized (contained a "honeycomb" of tiny air spaces) which may have made the bones more flexible as well as lighter. These and other skull-strengthening features are part of the tyrannosaurid trend towards an increasingly powerful bite, which easily surpassed that of all non-tyrannosaurids.The tip of the upper jaw was U-shaped (most non-tyrannosauroid carnivores had V-shaped upper jaws), which increased the amount of tissue and bone a tyrannosaur could rip out with one bite, although it also increased the stresses on the front teeth.
The teeth of T. rex displayed marked heterodonty (differences in shape). The premaxillary teeth at the front of the upper jaw were closely packed, D-shaped in cross-section, had reinforcing ridges on the rear surface, were incisiform (their tips were chisel-like blades) and curved backwards. The D-shaped cross-section, reinforcing ridges and backwards curve reduced the risk that the teeth would snap when Tyrannosaurus bit and pulled. The remaining teeth were robust, like "lethal bananas" rather than daggers; more widely spaced and also had reinforcing ridges.Those in the upper jaw were larger than those in all but the rear of the lower jaw. The largest found so far is estimated to have been 30 centimetres (12 in) long including the root when the animal was alive, making it the largest tooth of any carnivorous dinosaur.
Many of us have come to understand that it is the powers of nature rather than spooks in the sky that drives all species to compete for survival, and realize that we must devise ways to overcome the need to compete for the earthly resources that sustain our livelihood. We now have the transportation and communication technology to govern the planet with a single administration, and could prevent the costs and sorrows of war by uniting the nations. Then we would no longer need large populations to supply us with plentiful cannon fodder, or the modern technical weaponry to defeat each other with. By eliminating the need for trade and immigration restrictions we could save still more. By offering such huge savings to the public we should, in effect, be able to bribe the masses into abandoning their attempts to gain legislated advantages over each other. By so doing, we could additionally save the enormous expense of holding periodic elections, and the high salaries and perks of the representatives that gain their support through providing the majorities with legislation that economically appeases them: ridding ourselves of the scoundrels that lead us to commit such atrocities upon each other.
Without politicians and governmental programs for the unemployable, we would have to revert back to the times where family groups cared for their own invalids and elders, and with the tax money retained, could again provide assistance or disability insurance for the truly needy. This would prevent the present welfare scams, and second generations that become accustomed to living on the dole: for relatives wouldn't continue to slave for those that were inconsiderate of them. People should be more concerned with the able bodied, and strive to prevent further deterioration of the planet's life supporting environment. As well we must use our advancing intelligence to overcome our need to compete, rather than by using our animalistic instincts to compete to the best of our ability. Avoiding remaining our own worst enemy, and providing ourselves with an environment where we are able to respect each others equality through taking the initiative to use our advancing wisdom and abilities to guide our civilization to its highest potential for all time. However, don't vote for me, I'm only trying to tell you how you should run the whole shebang. It is you that must learn to lead yourselves: rather than be led to an untimely end, like a herd of sheep. Probably we should arrange to have weekly gatherings and use modern communication devises as we do in the present, to convert us from our present national, political, and religious conflictions, to bring us to the bountifulness that a species that is one of mind and purpose can provide for itself.