From 8ae4020a88a0f2192274e6d6543b692220e65e52 Mon Sep 17 00:00:00 2001 From: KunoiSayami Date: Fri, 1 Jul 2022 02:40:08 +0800 Subject: feat(script): Swift normal distribution lower to zero Signed-off-by: KunoiSayami --- normal_distribution.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'normal_distribution.cpp') 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 -- cgit v1.3.1