]> git.nega.tv - josh/narcissus/commit
Be more defensive when doing range reduction
authorJoshua Simmons <josh@nega.tv>
Fri, 21 Oct 2022 21:05:21 +0000 (23:05 +0200)
committerJoshua Simmons <josh@nega.tv>
Fri, 21 Oct 2022 21:05:21 +0000 (23:05 +0200)
commit0872ec6e4ac9ae4778b9caf5ac875fba727323bf
tree7c034a4caae4eda620df767cb0764fe15ff3ecec
parente295063655c3605aa5fe0ec93bac5389a993cedb
Be more defensive when doing range reduction

f32 as u32 saturates in rust, using to_int_unchecked wasn't currently
saturating on x86, but it's conceivable that it might. Go the long way
around by converting first to i32 and then to u32 in order to avoid the
possibility.
narcissus-maths/src/sin_cos_pi.rs
narcissus-maths/src/tan_pi.rs