Browse Prior Art Database

# Faster Decimal Division

IP.com Disclosure Number: IPCOM000034206D
Original Publication Date: 1989-Jan-01
Included in the Prior Art Database: 2005-Mar-09
Document File: 2 page(s) / 9K

IBM

## Related People

Arnold, HH: AUTHOR [+3]

## Abstract

Disclosed is a method to perform division in an environment (such as a data base environment) where the dividend, divisor, and quotient are kept in packed fields with a common fixed length. This method minimizes the computation involved by performing an easier but equivalent division. A packed field is a sequence of bytes (characters), each byte consisting of two nibbles. A nibble can contain a digit or a sign ('-' or '+') of the quantity being represented by the field. The field has a fixed size but the quantity need not have a fixed number of digits. That is, it need not fill the entire field. In addition to the field described above, each quantity is also described by two numbers called precision and scale. The precision is the number of digits in the quantity. The sign nibble is always the right nibble of its byte.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 53% of the total text.

Page 1 of 2

Faster Decimal Division

Disclosed is a method to perform division in an environment (such as a data base environment) where the dividend, divisor, and quotient are kept in packed fields with a common fixed length. This method minimizes the computation involved by performing an easier but equivalent division.

A packed field is a sequence of bytes (characters), each byte consisting of two nibbles. A nibble can contain a digit or a sign ('-' or '+') of the quantity being represented by the field.

The field has a fixed size but the quantity need not have a fixed number of digits. That is, it need not fill the entire field.

In addition to the field described above, each quantity is also described by two numbers called precision and scale. The precision is the number of digits in the quantity. The sign nibble is always the right nibble of its byte. Only nibbles proceeding it are considered digits of the quantity. The precision can be used to locate the sign nibble.

The scale is the number of those digits (immediately preceding the sign nibble) considered fraction digits (right of an imaginary decimal point). The decimal point is not a part of the field.

For discussion purposes, suppose that the length of the field is sixteen bytes. Sixteen bytes can hold thirty-one digits and a sign. Thus, 1 <= precision <= 31 and scale <= precision.

The division is performed after the operands have been converted from packed fields to ASCII character strings. Each string has the form

[leading zeros] [significant integer digits] ["."] ...

...[significant fraction digits] [trailing zeros] ["+" or "-"]

To minimize the effort in the division A/B, find two numbers A' and B' with fewer digits...