diff options
Diffstat (limited to 'bowshock/source/bs/rnd.cxx')
-rw-r--r-- | bowshock/source/bs/rnd.cxx | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/bowshock/source/bs/rnd.cxx b/bowshock/source/bs/rnd.cxx deleted file mode 100644 index 98f9523..0000000 --- a/bowshock/source/bs/rnd.cxx +++ /dev/null @@ -1,17 +0,0 @@ -// Copyright 2022-2023 Gabriel Jensen. - -#include <bow/bas.hxx> - -#include <cstdlib> - -static_assert(sizeof (int) == sizeof (::zp::i02)); - -static_assert(RAND_MAX == ::zp::maxval<int>::val); - -auto ::bow::rnd() noexcept -> ::zp::i04 { - ::zp::i02 const rnd0 = (::zp::i02)::std::rand(); - ::zp::i02 const rnd1 = (::zp::i02)::std::rand(); - ::zp::i04 const rnd = static_cast<::zp::i04>(rnd0) | static_cast<::zp::i04>(rnd1) >> 0x4u; - - return rnd; -} |