I don't think there is an easy solution for this without passing the real values to a string. This is mainly due to the fact that the real numbers may have an exact representation as decimal and an inexact representation as native. And, of course, vice-versa. For example, float 0.2 has an inexact native representation. The exact representation is 0.200000002980232. But the resolution present in a float is not enough for all the decimals. This just means that you probably won't have much luch analysing the bits in the float (or double). Their memory layout can be found in http://www.psc.edu/general/software/packages/ieee/ieee.html[^]. In any case, finding the values you want by using strings or not, this can always get complicated: float f=0.00031233478376329384729344178300483284723740923762730534976862e7f; double d=f; printf("f=%f, d=%.15g", f, d); This code compiles, but due to the lack of precision in the floating point representations the results are not what one would expect. So, the only fast solution I can imagine involves the assumption that you have not that many number variations, they are always around zero (controlled exponent), and that you do not have rounding errors. With these assumptions you could build a fast look up table. For example, assume that you will have numbers between -999.99 and +999.99. This results in 199998 diferent numbers plus the zero, i.e., 199999. So you could program the following algorithm: // build table float f; int i; i=0; for(f=-999.99; f<=-999.99; f+=0.01f) { table[i].left=ComputeLeftByUsingStrings(f); table[i].right=ComputeRightByUsingStrings(f); i++; } // get the left/right values for float f fast! f*=100.0f; // shift so that the smallest decimal becomes an integer int i=(int)f; // convert to int to use as offset to the table i+=99999; // correct the start offset to start at 0 for the most negative number int left=table[i].left; // left will contain the number of characters to the left int right=table[i].right; // right will contain the number of characters to the right I hope this helps! Rilhas