Espeer5 / Trinary

A ternary ALU simulation
https://espeer5.github.io/Trinary/
MIT License
2 stars 0 forks source link

Function to convert a decimal number to an array of Tris #1

Closed Espeer5 closed 1 year ago

Espeer5 commented 1 year ago

We need a function which will convert any decimal number to an array of Tris the length of a word. This will need to do a few things:

The Tri object and methods are in tri.js The WORD_SIZE is found in constants.js

Note that balanced ternary means every digit can be either 0, 1, or -1. So for example (base 10 to balanced ternary):

Espeer5 commented 1 year ago

Said function should be defined within conversions.js