dasp_sample/
ops.rs

1pub mod f32 {
2    #[allow(unused_imports)]
3    use core;
4
5    #[cfg(not(feature = "std"))]
6    pub fn sqrt(x: f32) -> f32 {
7        unsafe { core::intrinsics::sqrtf32(x) }
8    }
9    #[cfg(feature = "std")]
10    pub fn sqrt(x: f32) -> f32 {
11        x.sqrt()
12    }
13}
14
15pub mod f64 {
16    #[allow(unused_imports)]
17    use core;
18
19    #[cfg(not(feature = "std"))]
20    pub fn sqrt(x: f64) -> f64 {
21        unsafe { core::intrinsics::sqrtf64(x) }
22    }
23    #[cfg(feature = "std")]
24    pub fn sqrt(x: f64) -> f64 {
25        x.sqrt()
26    }
27}