]> git.nega.tv - josh/narcissus/commit
narcissus-maths: Add safe f32 to i32 conversions
authorJoshua Simmons <josh@nega.tv>
Sun, 5 May 2024 14:10:45 +0000 (16:10 +0200)
committerJoshua Simmons <josh@nega.tv>
Sun, 5 May 2024 14:10:45 +0000 (16:10 +0200)
commit50cf0c8aee8d80f5170bd2fc8cd2f19f0f21fb1b
tree4e03a2ee709250dc9709574532510792c10c640e
parent2976afd4220991901faabbbcda72a9f572579d34
narcissus-maths: Add safe f32 to i32 conversions

Rather than relying on `to_int_unsafe` which isn't valid for values that
overflow `i32`, implement an intrinsics based solution which merely
returns an implementation defined value for those cases.
engine/narcissus-maths/src/lib.rs