Strange issue with checking if( double > double)
<p>Here is my code</p>

<pre><code>    /**
 * Remove a file or software
 * @param filename name such as MyApp.apk
 * @return boolean true if executed
 */
private boolean isNewer(File toinst)
{
    boolean isnew = false;
    //String[] commands = new String[]{"ls /system/app/app_*"};
    String[] commands = new String[]{"cd /system/app" , "ls | /system/bin/busybox grep app"};
    String currentapk;

    // check that our app is already on there and what version
    try{
        currentapk = doCommand(commands).get(2);
        }
    // if there isn't one of our app on LIKELY ONLY IN THE CASE OF FIRST INSTALL
    catch(Exception ex)
    {
        isnew = true;
    }

    // get the version number of the one to install
    double toinstnum = getNumberFromName(toinst.getName());

    // get the version number of the one on the device currently
    double currentinstnum = getNumberFromName(currentapk);

    // if the toinstall version is larger return true
    if(toinstnum &gt; currentinstnum)
    {

        isnew = true;

    }
    else
    {
        isnew = false;
    }
    return isnew;
}
</code></pre>

<p>This method looks at what <code>app_No</code> is on the device and sees if the one I am inputing is new.</p>

<p>This gets to line <code>if(toinstnum &gt; currentinstnum)</code> showing both as <code>2.0</code> then the code will jump back up to the <code>Catch(Exception ex)</code> and set it to true instead of continuing.</p>

<p>Can anyone see where I have made a mistake? how is <code>2.0 &gt; 2.0</code> throwing an Exception.</p>
