Fractran: Difference between revisions

m
→‎{{header|Phix}}: improved comments
(→‎{{header|Phix}}: bugfix: prime_factors(1) now returns {1}, upped the ante)
m (→‎{{header|Phix}}: improved comments)
Line 2,762:
 
Notice that 2, being a power of 2, has zero in all slots other than 2.<br>
We can say that (eg) 15 is not exactly divisible by 2 because thean power of 2 is too largesq_sub({0, i.e1,1}, comparing {1,0,0}) withwould {0,1,1}contain there is a 1>0 in the 2some slot<0s.<br>
We can also say that 15 is not a power of 2 because there are non-0 in other than n[find(2,known_factors)].<br>
Division (to whole integer) is performed simply by subtracting the corresponding powers, as above not possible if any would be negative.
 
<lang Phix>constant steps = 20,
7,820

edits