18.08.2013 Views

(SYSLIB) Programming Reference Manual - Public Support Login ...

(SYSLIB) Programming Reference Manual - Public Support Login ...

(SYSLIB) Programming Reference Manual - Public Support Login ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

AEDIT$–ASCII Image Composition Editing Package<br />

4.2.2. Floating-Point Editing Routines<br />

AEDIT$F edits floating-point numbers into one of two general formats.<br />

• Fixed decimal format (no exponent)<br />

• Scientific format<br />

Fixed Decimal Format<br />

A number edited in fixed decimal format consists of a sign (if negative) followed by the<br />

digits of the number with an embedded decimal point. The sign is present only if the<br />

number is negative; a positive number has no sign character.<br />

The floating-point editing routines require three parameters in addition to the address of<br />

the floating-point packet. The first two are called x and y and are supplied in S5 and S6<br />

of register A0. They specify the format of the edited number as described below. The<br />

third parameter is the single- or double-precision number to be edited. If single<br />

precision, the number is specified in A1; if double precision, the number is specified in<br />

registers A1 and A2.<br />

The x parameter specifies the width of the edited field; in other words, the number of<br />

character positions that the edited number will occupy, including sign and decimal point.<br />

If the value of x is too small to represent the value being edited, it is ignored, and as<br />

many character positions are used as are required to correctly represent the number.<br />

The y parameter specifies how many fractional digits will be edited. This is the number<br />

of digits appearing to the right of the decimal point. The value of y may be any value<br />

greater than or equal to zero, but should always be less than the value of x to allow for<br />

the sign and decimal point characters.<br />

The maximum number of significant digits for which the floating-point routines can<br />

generate correct results in the fixed decimal format is 8 for single-precision numbers and<br />

17 for double precision. It includes digits on both the sides of the decimal point. This is<br />

because the 2200 single-precision floating-point format uses 27 bits for mantissa which<br />

can represent up to 8 decimal digits. The double-precision floating-point format uses 60<br />

bits for the mantissa which can represent up to 18 decimal digits. Rounding can be done<br />

at a maximum of the 18th digit. This will provide rounded results up to 17 digits. If the<br />

rounding option has been set with a value of y greater than 17 rounding will not be done<br />

by these routines.<br />

For example, the following numbers are in fixed decimal format:<br />

258.61 Requires parameter values of x > 6 and y = 2.<br />

-85.2239 Requires parameter values of x > 8 and y = 4.<br />

1093. Requires parameter values of x > 5 and y = 0.<br />

4–14 7833 1733–004

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

Saved successfully!

Ooh no, something went wrong!