Converting a 2-adic expansion to a fraction

32 Views Asked by At

I've been experimenting with the idea of using 2-adic expansions of numbers to efficiently do division on computers. For instance, if you have the 8-bit integer, 171(0b10101011), multiplied by 3 truncates to 1(in full it's 0b1000000001, which as an 8-bit number simply equals 1), meaning that it's effectively 1/3 in this number system. My question is if there's a way to convert this truncated number back to a fraction without simply multiplying it with every number until you find the one that equals one. Further, if I multiply two of these fractions together, is it possible to determine whether the result is a fraction or a whole number?