nedoPC.org

Community of electronics hobbyists established in 2002

...
Atom Feed | View unanswered posts | View active topics It is currently 24 May 2017 00:12



Reply to topic  [ 4 posts ] 
[Ternary] Ternary algorithms 
Author Message
Maniac

Joined: 17 Sep 2012 16:36
Posts: 277
Location: 81.170.128.52
Reply with quote
In Tunguska I've been "cheating" and using the native system to calculate most arithmetic operations.

So, to calculate %1A0 + %002, for an instance, I would convert the two numbers to binary (72 and 2), compute the result with C++'s + operator, and then convert back to ternary.

The ternary->binary conversion is very quick, but the binary->ternary algorithm is quite bulky. So I'm wondering if there are any established algorithms for ternary arithmetics (mainly addition, multiplication, division, and modulo)

Of course, I could probably get to it and make my own algorithms, but that feels an awful lot like re-inventing the wheel.


02 Mar 2008 10:01
Profile
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15335
Location: New York
Reply with quote
Fast ternary division by 2,4,8,10:
http://www.dyalog.dk/dfnsdws/n_JitSub.htm
http://dfns.dyalog.com/n_JitSub.htm


16 Aug 2008 00:05
Profile WWW
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15335
Location: New York
Reply with quote
Post 
web-site is not available anymore :(

_________________
:eugeek: https://twitter.com/Shaos1973


10 Nov 2012 10:02
Profile WWW
Admin
User avatar

Joined: 09 Jan 2003 02:22
Posts: 15335
Location: New York
Reply with quote
Post Re:
Shaos wrote:
web-site is not available anymore :(


changed link above to working one

_________________
:eugeek: https://twitter.com/Shaos1973


30 Jun 2015 15:13
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by ST Software.