Power of 10?

I'd like to check if an integer is a power of 10 and if so, do an action.I already have a ghetto way of checking but I'd like as elegant of a solution as possible.Am I missing something obvious?ThanksChris
[242 byte] By [whoknowsa] at [2007-11-26 21:00:32]
# 1
allrite i got it can i see your code pleaseeeeeeeeee?
fastmikea at 2007-7-10 2:31:27 > top of Java-index,Java Essentials,New To Java...
# 2
hmm if you are talking integer power, one '1' follow with '0's?
Icycoola at 2007-7-10 2:31:27 > top of Java-index,Java Essentials,New To Java...
# 3
It's a power of 10 if it's 1. Otherwise, it's a power of 10 if it's a multiple of 10 and when you divide it by 10 it's a power of 10.
DrClapa at 2007-7-10 2:31:27 > top of Java-index,Java Essentials,New To Java...
# 4

Sorry about that, I should have been more clear.

I don't really need any code fixes, just more of implementation suggestions.

Something as simple as

if (YourCodeHereForPowerOfTen(theinteger) == true)

System.out.println("sweet");

else

System.out.println("unsweet");

I thought of trying to just lop off the zeros but I wanted something more proper. I've also tried using

double i = Math.pow(10, theinteger);

to look for i=1 but it comes out to like 1.0E2, 1.0E3 etc and I cant figure out how to compare that without turning it to a string, comparing 1.0 with i.substring(0,2) but thats a whole lot of type changing. Anything smoother?

whoknowsa at 2007-7-10 2:31:27 > top of Java-index,Java Essentials,New To Java...