From f9b31768917a8daa9d2e176fc9e7a64d0de0c7f0 Mon Sep 17 00:00:00 2001 From: Martin Vajnar Date: Tue, 23 Jul 2013 12:06:37 +0200 Subject: [PATCH] JORTE: fraction computation Fix getDecimal() function. --- orte/java/src/org/ocera/orte/types/NtpTime.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/orte/java/src/org/ocera/orte/types/NtpTime.java b/orte/java/src/org/ocera/orte/types/NtpTime.java index d5e3470..89e3690 100644 --- a/orte/java/src/org/ocera/orte/types/NtpTime.java +++ b/orte/java/src/org/ocera/orte/types/NtpTime.java @@ -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 +} -- 2.39.2