From 6f5ed47f3fab437a235d443ba9402c9336126d40 Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Sat, 30 Aug 2025 18:54:04 -0500 Subject: [PATCH] todo and some other stuff --- readme.md | 6 ++++++ tests/test_add.cc | 38 -------------------------------------- tests/test_compilation.cc | 23 +++++++++++++++++++++++ 3 files changed, 29 insertions(+), 38 deletions(-) delete mode 100644 tests/test_add.cc create mode 100644 tests/test_compilation.cc diff --git a/readme.md b/readme.md index 63bad0d..bde468b 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,9 @@ # bmath header-only c++ 23 math library + +## todo + +[] sieves +[] factorization +[] `std::unsigned_integral` as modulus type diff --git a/tests/test_add.cc b/tests/test_add.cc deleted file mode 100644 index a27b25d..0000000 --- a/tests/test_add.cc +++ /dev/null @@ -1,38 +0,0 @@ -#include -#include -#include - -#include "../include/bmath.hh" - -using namespace bmath; -using namespace std; - -int main() { - constexpr uint64_t four{4}, five{5}; - constexpr mint mintfour{four}; - constexpr mint mintfive{five}; - - constexpr auto mintnine = mintfour + mintfive; - // static_assert(mintnine == four + five); - - // static_assert(4 + 5 == mint{9}); - static_assert(mint{8} == - mint{4} + mint{4}); - - static_assert(is_trivially_copyable_v>); - - // pow(mint{2}, 0); - - // cout << (std::format("x: {}\n", mintfour)); - - // auto res = mint{4} + mint{4}; - - // cout << (mint{5} + mint{7}); - // cout << pow(mint{4}, 5); - - // cout << to_string(pow(mint{5}, 5)); - - mint x{5}; - - return 0; -} diff --git a/tests/test_compilation.cc b/tests/test_compilation.cc new file mode 100644 index 0000000..e7112e7 --- /dev/null +++ b/tests/test_compilation.cc @@ -0,0 +1,23 @@ +#include +#include +#include + +#include "../include/bmath.hh" + +using namespace bmath; +using namespace std; + +int main() { + mint four{4}; + + // should be trivially copyable + static_assert(is_trivially_copyable_v>); + + // should be able to format + auto formatted = format("{}\n", four); + + // and use to_string + formatted = to_string(four); + + return 0; +}