summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Langesten <daniel.langest@gmail.com>2015-03-24 12:37:28 +0100
committerDaniel Langesten <daniel.langest@gmail.com>2015-03-24 12:37:28 +0100
commite031626c756d6dce1eca4ac9854332d507401a53 (patch)
tree1207886da2a8c6ca96ef71aefe1288d052fa1e02
parent448cd51fc01bcc987033d11d1de2409855718939 (diff)
reformated comments
-rw-r--r--diffpriv.go10
1 files changed, 6 insertions, 4 deletions
diff --git a/diffpriv.go b/diffpriv.go
index 14919b7..6cf09f1 100644
--- a/diffpriv.go
+++ b/diffpriv.go
@@ -10,10 +10,12 @@ var (
rnd = rand.New(rand.NewSource(time.Now().UnixNano()))
)
-//Returns 0 if epsilon is less than or equal to 0.
-//Otherwise it picks a number from the laplace distribution
-//with the mean 0 and standard deviation sensitivity/epsilon.
-//This follows the definition of differential privacy noise addition.
+// Returns 0 if epsilon is less than or equal to 0.
+// Otherwise it picks a number from the laplace
+// distribution with the mean 0 and standard deviation
+// sensitivity/epsilon.
+// This follows the definition of differential privacy
+// noise addition.
func diffpriv(value int, sensitivity, epsilon float64) int {
if epsilon <= 0 {
return 0