mirror of
https://github.com/slendidev/smath.git
synced 2026-03-17 02:26:50 +02:00
Add .clang-format and format codebase
Signed-off-by: Slendi <slendi@socopon.com>
This commit is contained in:
@@ -24,20 +24,21 @@
|
||||
|
||||
#include <smath.hpp>
|
||||
|
||||
auto main() -> int {
|
||||
using namespace smath;
|
||||
auto main() -> int
|
||||
{
|
||||
using namespace smath;
|
||||
|
||||
Vec2d point;
|
||||
std::random_device rd;
|
||||
std::mt19937 rng{rd()};
|
||||
std::uniform_real_distribution<> dis(-5, 5);
|
||||
int i = 0;
|
||||
do {
|
||||
Vec2d add{dis(rng), dis(rng)};
|
||||
auto const n = point + add;
|
||||
std::println("{}: {:.2f} + {:.2f} -> {:.2f}", i, point, add, n);
|
||||
point = n;
|
||||
Vec2d point;
|
||||
std::random_device rd;
|
||||
std::mt19937 rng { rd() };
|
||||
std::uniform_real_distribution<> dis(-5, 5);
|
||||
int i = 0;
|
||||
do {
|
||||
Vec2d add { dis(rng), dis(rng) };
|
||||
auto const n = point + add;
|
||||
std::println("{}: {:.2f} + {:.2f} -> {:.2f}", i, point, add, n);
|
||||
point = n;
|
||||
|
||||
i++;
|
||||
} while (i < 15);
|
||||
i++;
|
||||
} while (i < 15);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user