Can I store a long value precisely in a double variable without any rounding error?
<p>I have written a converter which uses Double.parseDouble to convert string to long value. Because user some times give input in xx.xx format instead of pure integer format. Is there any possibility to lose information when parsing a long value using Double.parseDouble?</p>

<pre><code>static Long toLong(Object object) {
    if (object == null) {
        return null;
    }
    if (object instanceof Number) {
        return ((Number) object).longValue();
    }
    return new Double(Double.parseDouble(object.toString().trim())).longValue();
}
</code></pre>