]> rtime.felk.cvut.cz Git - orte.git/commitdiff
JORTE: fraction computation
authorMartin Vajnar <martin.vajnar@gmail.com>
Tue, 23 Jul 2013 10:06:37 +0000 (12:06 +0200)
committerMartin Vajnar <martin.vajnar@gmail.com>
Tue, 23 Jul 2013 10:06:37 +0000 (12:06 +0200)
Fix getDecimal() function.

orte/java/src/org/ocera/orte/types/NtpTime.java

index d5e34708338bd6b4259ab1ef561869586b8dcef6..89e36907cb37421ede943c5f3d0b608c7d727b30 100644 (file)
@@ -85,9 +85,9 @@ public class NtpTime {
    * Get NtpTime in its decimal form.
    * @return actual NtpTime's value
    **/
-  public long getDecimal()
+  public double getDecimal()
   {
-    return this.seconds + (this.fraction << 32);
+    return this.seconds + (double)this.fraction / ((long)1 << 32);
   }
     
   /* ****************************************************************** *
@@ -117,4 +117,4 @@ public class NtpTime {
    public static native
    String NtpTimeToStringUs(NtpTime time);
    
-}
\ No newline at end of file
+}