Direct Base-to-Base Conversion Algorithm: Integer and Fractional Parts with Array-Based Arithmetic
A Unified Approach for Exact Integer and Fractional Base Conversion
DOI:
https://doi.org/10.31224/5930Keywords:
base conversion, number systems, arbitrary precision, fractional conversion, array-based arithmetic, Algorithms, big integer, computational mathematics, high-precision computingAbstract
This paper introduces a direct, precise base-to-base conversion algorithm for numbers in arbitrary bases from 2 to 62, eliminating the need for intermediate decimal conversions. Unlike traditional approaches which convert through base 10 and suffer from floating-point rounding errors, our method employs array-based big integer arithmetic to maintain exact precision for both integer and fractional parts simultaneously. The algorithm processes digits from the source base one by one with inline normalization to the target base, avoiding floating-point operations altogether. We provide formal pseudocode for both integer and fractional parts, complexity analyses, and practical guidance for safe data-type selection. The integer conversion runs in O(n · m) time and fractional conversion in O(d · p), where n, m represent the count of source and target integer digits and d, p the source fractional digits and desired fractional precision. An open-source C++ implementation is available on GitHub. This approach enables exact, efficient conversions suitable for high-precision and arbitrarily large numeric data in modern computational applications.
Downloads
Downloads
Posted
Versions
- 2025-12-04 (2)
- 2025-12-04 (1)
License
Copyright (c) 2025 Darshangouda Patil

This work is licensed under a Creative Commons Attribution 4.0 International License.