Skip to content

FLOATING POINT

Exponential Numeric Mode

This directive removes the normal rounding in the manipulation of fixed-point numbers and uses an exponential form of representation for numbers exceeding the fixed-point size limits. 14-place computational accuracy is maintained within a range from +/-.99999999999999E-114 through +/-.99999999999999E+141.

FLOATING POINT

Thoroughbred Basic accepts and processes numbers expressed in exponential form whether or not FLOATING POINT is set.

FLOATING POINT and PRECISION are mutually exclusive directives.

FLOATING POINT is removed and PRECISION set by BEGIN, CLEAR, END, LOAD, PRECISION, RESET, or STOP directives, or a RUN directive that specifies a program name.

FLOATING POINT or PRECISION directives must be used if any numeric values are to be processed or output with more than 2 significant digits.

Although the exponent portion of a FLOATING POINT variable can range from +141 to -114, the exponent portion of a FLOATING POINT constant is limited to a range of +128 to -127.

FLOATING POINT

If X=.12345678901234, Y=12345678901234, and Z=.5E+128, values are processed as follows:

Value
Produces
5E-14
.00000000000005
5E-15
.5E-14

X*1E-13 .12345678901234E-13

Y*100
.12345678901234E+16
.654321
.654321
1E127
.1E+128
1E128
Error (exceeds max value)

1E127*10 .1E+129

1E-128
.1E-127
1E-129
Error (exceeds max value)
Z*100
.5E+130

PRECISION directive

From the Thoroughbred Basic Language Reference, Volume II: F–Q, version 8.9.1. Open this page in the PDF