You may try something like this which might work.
From your question, what I understand is you want integral value of pow(10,t) where t is log of some value.
You may try something of this sort.
ans = (int) (pow((double)10.0,(double)t) + EPS);
EPS could be a very small value. I would recommend to take it as 1e-9.
This should solve your problem mostly as to what I understood from the question.
To add further,
“pow is a floating-point function: double pow(double x, double y). Like most of the other standard floating-point functions, the result of pow is only guaranteed to be approximately correct. pow(10.0, 2.0) can be exactly 100.0, slightly greater, or slightly less. If pow(10.0, 2.0) is slightly less than 100.0, casting it to the type int converts it to 99.”
This link may help you understand more about power function precision.