(48G/49/50) Conversion To and From Base i-1
|
02-25-2023, 09:10 PM
(This post was last modified: 02-25-2023 09:11 PM by John Keith.)
Post: #1
|
|||
|
|||
(48G/49/50) Conversion To and From Base i-1
Complex base i-1 enables positive and negative integers, and Gaussian integers, to be represented by a nonnegative integer. More information in this paper.
The programs listed here convert between integers or complex numbers and their base i-1 representation. The programs are in the form of a directory because there are several sub-programs and several dependencies. The directory includes the programs I→DL and DL→I from this thread. These two programs can be removed from this directory if they are already in your path. The programs I→Bi1 and Bi1→I are for the conversion of positive or negative integers. They are short and fast because they take advantage of simple bit patterns. The programs Z→Bi1 and Bi1→Z are for the conversion of complex numbers (or imaginary numbers in the form of (0, n)). These programs are considerably larger and more.. complex. They are based on the Python programs here. The program Bi1ADD, which is used as a sub-program, adds two numbers encoded in base i-1 without needing to convert them first. Code:
|
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)