HP 3000 Manuals

FIXED [ HP Business BASIC/XL Reference Manual ] MPE/iX 5.0 Documentation


HP Business BASIC/XL Reference Manual

FIXED 

The FIXED statement sets the default numeric output format to fixed-point
and specifies the number of digits to be printed to the right of the
decimal point.  The FLOAT and STANDARD statements also set the default
numeric output format.

Syntax 

FIXED num_expr 

Parameters 

num_expr         Its rounded value, n, must be in the short integer
                 range.  When HP Business BASIC/XL outputs a number in
                 fixed-point format, it prints n digits to the right of
                 the decimal point.  If n is less than one, HP Business
                 BASIC/XL prints no decimal point and no decimal digits.
                 If n is greater than 16, HP Business BASIC/XL prints 16
                 decimal digits.

A numeric literal that is expressed in scientific notation can be printed
in fixed-point format, but it will be followed with E+nn for exponents
that are less than two digits andE+nnn for exponents that are three
digits.  Each n is a digit.

Examples 

     10 FIXED 2
     20 PRINT 123;.4567;-79810;-1.235E+47
     99 END

The above program prints:

     123.00   .46   -78910.00   -1.24E+47

If line 10 is changed to

     10 FIXED 3

then the program prints:

     123.000  .457  -78910.000  -1.234E+47



MPE/iX 5.0 Documentation