Floating-Point to String Conversion via Mantissa Shifting

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Existing methods for converting floating-point representations to character strings are inefficient, consuming substantial CPU time and reducing performance in web-based applications due to the need for numerous multiplication operations.

Innovation Solution

A method that extracts mantissa bits from the floating-point representation, shifts them, and uses a combination of division and multiplication operations, along with a lookup table, to convert the value into a format suitable for character string representation, reducing the number of multiplication operations required.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If standard conversion methods are used to convert floating-point numbers to character strings, then conversion accuracy is maintained, but CPU processing time increases substantially

Engineering Contradiction:
Improveconversion accuracyVSAvoidCPU processing time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent segments the conversion process into distinct phases: extracting the exponent to determine the number of multiplication operations needed, separating mantissa processing from exponent processing, and dividing the conversion into iterative steps that process one digit at a time. This segmentation allows the system to optimize each phase independently, reducing overall processing time while maintaining accuracy.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs multiplication operations selectively based on the exponent value. Instead of always performing the maximum number of multiplications required for the largest representable numbers, the system performs only the necessary number of multiplications (equal to the exponent value) for each specific conversion task. This partial action approach significantly reduces average processing time while ensuring sufficient precision for each case.

Inventive Principle:
Principle #16Partial or excessive action

2Productivity

If the number of multiplication operations is reduced to improve conversion speed, then CPU processing time decreases, but conversion accuracy may be compromised

Engineering Contradiction:
Improveconversion speedVSAvoidconversion accuracy
Core Design Contradiction:
ProductivityVSMeasurement precision

Solution Approach 1:

The patent incorporates feedback mechanisms where the exponent value determines the number of multiplication operations to perform, and the iteration continues until the desired precision is achieved. The system monitors the conversion progress and adjusts the number of operations dynamically, ensuring that enough multiplications are performed to maintain accuracy while avoiding unnecessary operations that would waste time.

Inventive Principle:
Principle #23Feedback

Solution Approach 2:

The patent changes the parameter of multiplication count based on the exponent value of the input number. By dynamically adjusting this parameter rather than using a fixed number of operations, the system optimizes the balance between speed and accuracy for each specific conversion case, performing fewer operations for smaller exponents and more operations only when necessary for larger exponents.

Inventive Principle:
Principle #35Parameter changes

3Ease of manufacture

If a straightforward conversion algorithm is used, then implementation simplicity is maintained, but web server performance deteriorates due to high CPU consumption

Engineering Contradiction:
Improveimplementation simplicityVSAvoidweb server performance
Core Design Contradiction:
Ease of manufactureVSProductivity

Solution Approach 1:

The patent performs preliminary extraction of the exponent value before entering the main conversion loop. This preliminary action allows the system to determine in advance how many multiplication operations will be needed, enabling optimized resource allocation and avoiding unnecessary computational steps. The exponent is processed first to set up the conversion parameters, improving overall efficiency while maintaining algorithmic clarity.

Inventive Principle:
Principle #10Preliminary action

Data Source

PatentUS7685213B2Conversion of floating-point numbers from binary into string format
Publication Date: 2010.03.23 ORACLE AMERICAN INC
  • US7685213B2 patent drawing
  • US7685213B2 patent drawing
  • US7685213B2 patent drawing

AI summary

A method, system, and computer program product that convert a real number from a floating point representation to a character string. Mantissa bits are extracted from the floating-point representation of a value into an integer format. The mantissa bits of the integer format may be shifted left by a number of positions that is equal to a base 2 exponent of a first representation of the value. Prior to converting the value, the floating-point representation of the value can be divided by 2n, where n is the number of the mantissa bits in the floating-point representation of the value. A set of operations can then be performed to convert a result of the division to a number greater than or equal to 1.0 and less than 10.0. The set of operations may include multiplication operations and/or retrieving a constant from a lookup table.