hex_math/num.rs
1use core::intrinsics::{cosf32, sinf32, sqrtf32};
2
3pub trait Real {
4 fn sqrt(self) -> Self;
5 fn sin(self) -> Self;
6 fn cos(self) -> Self;
7}
8
9impl Real for f32 {
10 fn sqrt(self) -> Self {
11 unsafe { sqrtf32(self) }
12 }
13
14 fn sin(self) -> Self {
15 unsafe { sinf32(self) }
16 }
17
18 fn cos(self) -> Self {
19 unsafe { cosf32(self) }
20 }
21}