Preprint / Version 2

Direct Base-to-Base Conversion Algorithm: Integer and Fractional Parts with Array-Based Arithmetic

A Unified Approach for Exact Integer and Fractional Base Conversion

##article.authors##

  • Darshangouda Patil Independent Researcher

DOI:

https://doi.org/10.31224/5930

Keywords:

base conversion, number systems, arbitrary precision, fractional conversion, array-based arithmetic, Algorithms, big integer, computational mathematics, high-precision computing

Abstract

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

Download data is not yet available.

Downloads

Posted

2025-12-04 — Updated on 2025-12-04

Versions

Version justification

Added Subject, ( I can't update previous version)