Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

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.

share|improve this question
1  
If you know how many Ns there are after the decimal point, you can just multiply with an appropriate power of $10$. –  Gregor Bruns Nov 23 '12 at 15:20
    
@peter: Can you provide more specifics? Also, what is the application? I can imagine some things you might be trying to do for which there is a much simpler way than trying to solve the mathematical problem you are trying to describe. –  Hurkyl Nov 23 '12 at 15:21
    
Do you mean you want to convert a "terminating" decimal number to a fraction? –  David Carraher Nov 23 '12 at 15:29
add comment

1 Answer

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.

share|improve this answer
    
I want the resultant integer to be small like 4 numerals –  peter Nov 23 '12 at 15:47
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.