0
$\begingroup$

I'm trying to come up with a formula to reliably reduce a number like NNN.NNNN to a simple integer – NNNN such that NNNN can be converted back to NNN.NNNN as it were before using the inverse of the same formula.

Would be grateful if you could provide some formula or pointers in that direction.

  • 0
    Do you mean you want to convert a "terminating" decimal number to a fraction?2012-11-23

1 Answers 1

1

If you only deal with finite digits then you can simply start with a 1, and then start at the dot and interchange the digits from left right.

For example $13212.312$ becomes $1231122301$. You need to start with a 1, just in case the last digit of the number is 0. Going back is easy.

If you original number is any real number, such a formula cannot exist since $\mathbb R$ is uncountable.

  • 0
    I want the resultant integer to be small like 4 numerals2012-11-23