Extended-precision floating-point (##)

Extended-precision floating-point numbers are the basis of floating-point computation in PowerBASIC.  The type-specifier character for an Extended-precision floating-point is: ##.

In PowerBASIC, arithmetic is optimized; it doesn't use Extended-precision unless it needs to.  Extended-precision has been provided as a declarable data type, so that you can take advantage of its extra exponent range and precision if you wish.

Extended-precision values require 10 bytes of storage each.  They have a range of approximately  +/- 3.4*10^-4932 to 1.2*10^4932, and offer 18 digits of precision.  All 18 digits can be "displayed" using the extended STR$ format (eg, STR$(var##,18)).

Extended-precision variables are identified by adding two Number symbols following a variable name (i.e., var##) or by using the DEFEXT statement..  You can also declare Extended-precision variables using the EXT or EXTENDED keywords with the DIM statement.  For example:

DIM I AS EXT

DIM J AS EXTENDED

STR$ works with up to 16 significant digits (enough for a Double-precision value) by default.  To get all 18 significant digits of an Extended-precision number in a string, use the enhanced STR$ function to specify 18 digits:

x$ = STR$(a##,18)

 

 

See Also

Array Data Types

Bit Data Types

Constants and Literals

Floating Point Data Types 

GUID Data Types

Integer Data Types 

Object Data Types

Pointer Data Types

String Data Types 

User Defined Types

Unions

Variant Data Types