Skip to content
PatentGenius

United States Patent

US Patent 5652862: Method and appartus for determining a precision…

US 5652862  ·  granted 1997-07-29

Abstract

A method and apparatus for efficient allocation of temporary storage for performing accurate and correct numeric base conversions on a computer system is provided. Numeric base conversions are common because computers operate in binary whereas the values that are input into computers are based on a decimal system. A common source of error occurs when converted values are rounded. The intermediate arithmetic used to perform the conversion requires greater precision than the target floating point format. It is known that to always insure correctly rounded results, an extremely high precision intermediate arithmetic may be used. However, in many case this is a waste of system memory. To efficiently allocate system memory to this task, the most difficult rounding case is determined. The precision needed to correctly round the most difficult case is then derived. This information is then stored and subsequently used to allocate an efficient amount of storage whenever a numeric base conversion is to take place.

Patent Number 5652862
Title Method and appartus for determining a precision of an intermediate arithmetic for converting values between a first numeric format and a second numeric format
Filed 1995-09-05
Granted 1997-07-29
Inventor(s) Hanson; Kenton L.
Assignee Apple Computer, Inc.
Number of Claims 40

Abstract

A method and apparatus for efficient allocation of temporary storage for performing accurate and correct numeric base conversions on a computer system is provided. Numeric base conversions are common because computers operate in binary whereas the values that are input into computers are based on a decimal system. A common source of error occurs when converted values are rounded. The intermediate arithmetic used to perform the conversion requires greater precision than the target floating point format. It is known that to always insure correctly rounded results, an extremely high precision intermediate arithmetic may be used. However, in many case this is a waste of system memory. To efficiently allocate system memory to this task, the most difficult rounding case is determined. The precision needed to correctly round the most difficult case is then derived. This information is then stored and subsequently used to allocate an efficient amount of storage whenever a numeric base conversion is to take place.

Claim 1

On a computer system, a method for converting values between a first numeric format and a second numeric format, said method comprising the steps of: a) identifying a most difficult rounding case in said first numeric format; b) determining a minimum number of bits to represent said most difficult rounding case during conversion operations, said minimum number of bits being a least number of bits required to correctly round said most difficult rounding case duringconversion from said first numeric format to said second numeric format; c) establishing the minimum number of bits as a minimum precision; d) storing, in a predetermined location, data that represents an intermediate precision, wherein said intermediate precision is based upon said minimum precision and has at least as many bits as said minimum precision; e) invoking a conversion for a value to convert the value from said first numeric format to said second numeric format; f) retrieving said data from said predetermined location; g) storing a representation of said value in said intermediate precision; h) converting said value to said second numeric format by performing conversion operations on said representation of said

Claims

40 total

On a computer system, a method for converting values between a first numeric format and a second numeric format, said method comprising the steps of: a) identifying a most difficult rounding case in said first numeric format; b) determining a minimum number of bits to represent said most difficult rounding case during conversion operations, said minimum number of bits being a least number of bits required to correctly round said most difficult rounding case duringconversion from said first numeric format to said second numeric format; c) establishing the minimum number of bits as a minimum precision; d) storing, in a predetermined location, data that represents an intermediate precision, wherein said intermediate precision is based upon said minimum precision and has at least as many bits as said minimum precision; e) invoking a conversion for a value to convert the value from said first numeric format to said second numeric format; f) retrieving said data from said predetermined location; g) storing a representation of said value in said intermediate precision; h) converting said value to said second numeric format by performing conversion operations on said representation of said