feat(math): add CMath::fint_n

This commit is contained in:
fallenoak 2022-12-26 14:13:25 -06:00
parent 9987c5522b
commit 444f05b59a
No known key found for this signature in database
GPG key ID: 7628F8E61AEA070D

View file

@ -17,6 +17,10 @@ class CMath {
return static_cast<int32_t>(n); return static_cast<int32_t>(n);
} }
static int32_t fint_n(float n) {
return n <= 0.0f ? static_cast<int32_t>(n - 0.5f) : static_cast<int32_t>(n + 0.5f);
}
static uint32_t fuint(float n) { static uint32_t fuint(float n) {
return static_cast<uint32_t>(n); return static_cast<uint32_t>(n);
} }