Among other things: you cannot really make a satisfactory model of a real number using two integers. The best known model is the floating-point model which is based on

*significand*,

*coefficient*,

*mantissa*, and

*exponent* and already exists and standardized as IEEE 754:

http://en.wikipedia.org/wiki/Floating_point[

^],

http://en.wikipedia.org/wiki/IEEE_754[

^].

This is a binary representation; and you are trying to work with strings instead of binary objects, which is itself is a pointless activity — working with string representation of data instead of data itself.

By the way, do you understand that a mathematical real number, its single instance, in general case, carries infinite amount of information?

I would advice you to stop doing what you are doing and learn some mathematics and elementary computer science around these problems.

—SA
Should I also mark it off-topic? Here is why: this is a site for software developers and students; and software developers never say "it does not work", only lame users do. The software developers, even the beginners, say what exactly goes wrong, in what line of code. They provide comprehensive issue report.

In your case, you could run it under debugger to see what's wrong and ask a question if you still cannot understand the behavior or don't see how to fix it.

Use "Improve question" above.

--SA

What is the actual problem you are having?

--SA