pub fn sin(x: f32) -> f32 {
#[cfg(feature = "std")]
{
x.sin()
}
#[cfg(not(feature = "std"))]
{
libm::sinf(x)
}
}
pub fn cos(x: f32) -> f32 {
#[cfg(feature = "std")]
{
x.cos()
}
#[cfg(not(feature = "std"))]
{
libm::cosf(x)
}
}
pub fn tan(x: f32) -> f32 {
#[cfg(feature = "std")]
{
x.tan()
}
#[cfg(not(feature = "std"))]
{
libm::tanf(x)
}
}
pub fn atan2(y: f32, x: f32) -> f32 {
#[cfg(feature = "std")]
{
y.atan2(x)
}
#[cfg(not(feature = "std"))]
{
libm::atan2f(y, x)
}
}
pub fn sqrt(x: f32) -> f32 {
#[cfg(feature = "std")]
{
x.sqrt()
}
#[cfg(not(feature = "std"))]
{
libm::sqrtf(x)
}
}
pub fn sqrt64(x: f64) -> f64 {
#[cfg(feature = "std")]
{
x.sqrt()
}
#[cfg(not(feature = "std"))]
{
libm::sqrt(x)
}
}
pub fn round(x: f32) -> f32 {
#[cfg(feature = "std")]
{
x.round()
}
#[cfg(not(feature = "std"))]
{
libm::roundf(x)
}
}
pub fn acos(x: f32) -> f32 {
#[cfg(feature = "std")]
{
x.acos()
}
#[cfg(not(feature = "std"))]
{
libm::acosf(x)
}
}
pub fn ln(x: f32) -> f32 {
#[cfg(feature = "std")]
{
x.ln()
}
#[cfg(not(feature = "std"))]
{
libm::logf(x)
}
}
pub fn floor(x: f32) -> f32 {
#[cfg(feature = "std")]
{
x.floor()
}
#[cfg(not(feature = "std"))]
{
libm::floorf(x)
}
}
pub fn trunc(x: f32) -> f32 {
#[cfg(feature = "std")]
{
x.trunc()
}
#[cfg(not(feature = "std"))]
{
libm::truncf(x)
}
}
pub fn fract(x: f32) -> f32 {
#[cfg(feature = "std")]
{
x.fract()
}
#[cfg(not(feature = "std"))]
{
x - libm::truncf(x)
}
}
pub fn powf(x: f32, n: f32) -> f32 {
#[cfg(feature = "std")]
{
x.powf(n)
}
#[cfg(not(feature = "std"))]
{
libm::powf(x, n)
}
}
pub fn powi(x: f32, n: i32) -> f32 {
#[cfg(feature = "std")]
{
x.powi(n)
}
#[cfg(not(feature = "std"))]
{
libm::powf(x, n as f32)
}
}
pub fn powi64(x: f64, n: i32) -> f64 {
#[cfg(feature = "std")]
{
x.powi(n)
}
#[cfg(not(feature = "std"))]
{
libm::pow(x, n as f64)
}
}
pub fn cbrt(x: f32) -> f32 {
#[cfg(feature = "std")]
{
x.cbrt()
}
#[cfg(not(feature = "std"))]
{
libm::cbrtf(x)
}
}