FRACTRAN Interpreter

by Ricardo Fernández Serrata

Version 1 (November 22, 2020)

Download (0 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 {pow(2, A) * pow(3, B)}. After this program returns output, you must 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.

It works but the only problem is that some fractions don't have very precise values, 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. This ADD always works correctly.

en.wikipedia.org/wiki/FRACTRAN

2.0 average rating from 2 reviews

5 stars
0
4 stars
0
3 stars
1
2 stars
0
1 star
1
Reports
0

Reviews and ratings can be submitted in the app.