From 316bb4380e276a0b9e2745ad126a5c6c0e4b221d Mon Sep 17 00:00:00 2001
From: riku <risaku@163.com>
Date: 星期一, 22 十一月 2021 13:28:18 +0800
Subject: [PATCH] 2021.11.22
---
src/main/kotlin/com/flightfeather/uav/dataprocess/AvgPair.kt | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/src/main/kotlin/com/flightfeather/uav/dataprocess/AvgPair.kt b/src/main/kotlin/com/flightfeather/uav/dataprocess/AvgPair.kt
index 02daa91..6267a69 100644
--- a/src/main/kotlin/com/flightfeather/uav/dataprocess/AvgPair.kt
+++ b/src/main/kotlin/com/flightfeather/uav/dataprocess/AvgPair.kt
@@ -1,11 +1,13 @@
package com.flightfeather.uav.dataprocess
+import kotlin.math.round
+
data class AvgPair(
var t: Float, var c: Int
){
fun avg(): Float = if (c == 0) {
0f
} else {
- t / c
+ round(t / c * 1000) / 1000
}
}
\ No newline at end of file
--
Gitblit v1.9.3