summaryrefslogtreecommitdiff
path: root/normal_distribution.cpp
diff options
context:
space:
mode:
authorKunoiSayami <[email protected]>2022-07-01 02:40:08 +0800
committerKunoiSayami <[email protected]>2022-07-01 02:40:08 +0800
commit8ae4020a88a0f2192274e6d6543b692220e65e52 (patch)
tree92d803c6a6da089514dc802984a66911f18795f6 /normal_distribution.cpp
parent0b2735596e8969c08797f18977c626f423b3ab6d (diff)
feat(script): Swift normal distribution lower to zero
Signed-off-by: KunoiSayami <[email protected]>
Diffstat (limited to 'normal_distribution.cpp')
-rw-r--r--normal_distribution.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/normal_distribution.cpp b/normal_distribution.cpp
index bc56e2a..002beba 100644
--- a/normal_distribution.cpp
+++ b/normal_distribution.cpp
@@ -26,11 +26,17 @@ int main() {
if (ret.second) {
vector.push_back(element);
// TODO: add offset
- printf("%lld\n", element);
+ // printf("%lld\n", element);
}
}
assert(vector.size() == length);
+ auto offset = *set.begin() < 0 ? 0 - *set.begin() : 0;
+
+ for (auto element : vector) {
+ printf("%lld\n", element + offset);
+ }
+
return 0;
} \ No newline at end of file