I have a number, say 145725, and I have to convert it to another form in the following way 145 + ((72 + 5/2) / 100), where 145 is the first 3 digit, 72 is fourth & fifth digits, 5 is the last digit.
I get the result. Now I have to convert back to original form. I tried to find out a general formula. But failed to do so. Can anybody help me out?
145 + ((72 + 5/2) / 100) is not equal to 145725.
Are you talking about concatenation or regular mathematical addition?
yes, 145 + ((72 + 5/2) / 100) is not equal to 145725.
Assume, the number as a string. Please do not compare its equality. But I have to convert back it to original form.
If I'm understanding this correctly, you're taking some 6-digit number abcdef and using that to get a new number, given by abc + (de + f/2)/100.
In your example, 145725 would convert to 145 + (72 + 5/2)/100 = 145.745.
You want to find a way of taking a number that has been converted already, and working out what number was used to convert it.
Unfortunately, there is more than one number that produces 145.745, when you convert numbers using that method. You can have:
Since more than one number can give the same converted number, you can't deduce what number was used to produce a converted number (in general).
Why did the vector cross the road?
It wanted to be normal.