diff options
Diffstat (limited to 'diffpriv.go')
-rw-r--r-- | diffpriv.go | 10 |
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 |