FRACTRAN Interpreter

by Ricardo Fernández Serrata

Version 2 (January 18, 2021)

Download (5 downloads)

This works as Wikipedia says (n * (x/y)). {n} is the input and {f_ls} is the list of fractions (the program). I made this flow so that unhaltable programs are able to print/display output.

The default program here is ADD or SUM but to add A to B, {n} must be of the form {pow(2, A) * pow(3, B)}. After this program returns output, you need to do {log(n) / log(3)} (gets logarithm of n in base 3, or just ternary logarithm of n) so that you know the actual answer or result.

The Interpreter works but the only problem is that some fractions don't have very precise values (float errors), so sometimes it incorrectly detects that {n} cannot be multiplied (even though it can) by a Float, so some multiplications are skipped by some programs. I think I've fixed this in the current update. This ADD always works correctly.

2.0 average rating from 2 reviews

5 stars
4 stars
3 stars
2 stars
1 star

Reviews and ratings can be submitted in the app.