13.07.2015 Views

Turbo Basic

Turbo Basic

Turbo Basic

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

The density of representable values is not distributed evenly along the numberline. An equal number of representable values exists between successive powers oftwo. For example, there are as many representable values between 1 and 2 as thereare between 131,072 and 262,144. In other words, the gaps between representablevalues get larger as you move farther from zero in either direction on the numberline. Eventually, you get so far away from zero that there are no representablepoints left. Producing numbers beyond the last representable value in either directionis called overflow.Overflow and UnderflowFloating-point overflow occurs when a result is calculated greater than the maximumpositive· representable value or less than the most negative representablevalue. Because of the wide range of values permitted by <strong>Turbo</strong> <strong>Basic</strong>, floating-pointoverflow is a relatively unusual occurrence. Unlike integer overflow, floating-pointoverflow is always detected.Floating-point underflow occurs when a result falls within the tiny gap betweeno and the first representable points on either the positive or negative arms of thenumber line. <strong>Turbo</strong> <strong>Basic</strong>'s math routines handle underflow by inserting a 0 inplace of the underflow result, and then continue execution without producing anerror message.Single-Precision Floating Point<strong>Turbo</strong> <strong>Basic</strong> single-precision values are IEEE standard short reals. This formatrequires 4 bytes of memory, and results in a precision of 6 to 7 decimal digits and arange of approximately8.43 x 10- 37 S Ixl s 3.37 x 10 38Single-precision values consist of a 23-bit normalized mantissa, an 8-bit exponentwith a bias of 7FH, and a sign bit, arranged as shown in Figure A-I. (Biasrefers to the difference between the unsigned integer within the exponent field of afloating-point number and the exponent it represents.)386 <strong>Turbo</strong> <strong>Basic</strong> Owner's Handbook

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!