|
| 1 | +// Config is needed for times when this module is available but we don't call everything |
| 2 | +#![allow(dead_code)] |
| 3 | + |
| 4 | +pub fn ceil(x: f64) -> f64 { |
| 5 | + // SAFETY: safe intrinsic with no preconditions |
| 6 | + unsafe { core::intrinsics::ceilf64(x) } |
| 7 | +} |
| 8 | + |
| 9 | +pub fn ceilf(x: f32) -> f32 { |
| 10 | + // SAFETY: safe intrinsic with no preconditions |
| 11 | + unsafe { core::intrinsics::ceilf32(x) } |
| 12 | +} |
| 13 | + |
| 14 | +pub fn fabs(x: f64) -> f64 { |
| 15 | + // SAFETY: safe intrinsic with no preconditions |
| 16 | + unsafe { core::intrinsics::fabsf64(x) } |
| 17 | +} |
| 18 | + |
| 19 | +pub fn fabsf(x: f32) -> f32 { |
| 20 | + // SAFETY: safe intrinsic with no preconditions |
| 21 | + unsafe { core::intrinsics::fabsf32(x) } |
| 22 | +} |
| 23 | + |
| 24 | +pub fn floor(x: f64) -> f64 { |
| 25 | + // SAFETY: safe intrinsic with no preconditions |
| 26 | + unsafe { core::intrinsics::floorf64(x) } |
| 27 | +} |
| 28 | + |
| 29 | +pub fn floorf(x: f32) -> f32 { |
| 30 | + // SAFETY: safe intrinsic with no preconditions |
| 31 | + unsafe { core::intrinsics::floorf32(x) } |
| 32 | +} |
| 33 | + |
| 34 | +pub fn sqrt(x: f64) -> f64 { |
| 35 | + // SAFETY: safe intrinsic with no preconditions |
| 36 | + unsafe { core::intrinsics::sqrtf64(x) } |
| 37 | +} |
| 38 | + |
| 39 | +pub fn sqrtf(x: f32) -> f32 { |
| 40 | + // SAFETY: safe intrinsic with no preconditions |
| 41 | + unsafe { core::intrinsics::sqrtf32(x) } |
| 42 | +} |
| 43 | + |
| 44 | +pub fn trunc(x: f64) -> f64 { |
| 45 | + // SAFETY: safe intrinsic with no preconditions |
| 46 | + unsafe { core::intrinsics::truncf64(x) } |
| 47 | +} |
| 48 | + |
| 49 | +pub fn truncf(x: f32) -> f32 { |
| 50 | + // SAFETY: safe intrinsic with no preconditions |
| 51 | + unsafe { core::intrinsics::truncf32(x) } |
| 52 | +} |
0 commit comments