#[cfg(feature = "std")]
pub use std::vec::Vec;
#[cfg(all(not(feature = "std"), feature = "alloc"))]
pub use alloc::vec::Vec;
#[cfg(feature = "std")]
pub use std::vec;
#[cfg(all(not(feature = "std"), feature = "alloc"))]
pub use alloc::vec;
#[cfg(feature = "std")]
pub use std::string::String;
#[cfg(all(not(feature = "std"), feature = "alloc"))]
pub use alloc::string::String;
#[cfg(feature = "std")]
pub use std::format;
#[cfg(all(not(feature = "std"), feature = "alloc"))]
pub use alloc::format;
pub mod math {
#[inline(always)]
pub fn sqrtf(x: f32) -> f32 {
#[cfg(feature = "std")]
{
x.sqrt()
}
#[cfg(not(feature = "std"))]
{
libm::sqrtf(x)
}
}
#[inline(always)]
pub fn atan2f(y: f32, x: f32) -> f32 {
#[cfg(feature = "std")]
{
y.atan2(x)
}
#[cfg(not(feature = "std"))]
{
libm::atan2f(y, x)
}
}
#[inline(always)]
pub fn sinf(x: f32) -> f32 {
#[cfg(feature = "std")]
{
x.sin()
}
#[cfg(not(feature = "std"))]
{
libm::sinf(x)
}
}
#[inline(always)]
pub fn cosf(x: f32) -> f32 {
#[cfg(feature = "std")]
{
x.cos()
}
#[cfg(not(feature = "std"))]
{
libm::cosf(x)
}
}
#[inline(always)]
pub fn fabsf(x: f32) -> f32 {
#[cfg(feature = "std")]
{
x.abs()
}
#[cfg(not(feature = "std"))]
{
libm::fabsf(x)
}
}
#[inline(always)]
pub fn expf(x: f32) -> f32 {
#[cfg(feature = "std")]
{
x.exp()
}
#[cfg(not(feature = "std"))]
{
libm::expf(x)
}
}
#[inline(always)]
pub fn floorf(x: f32) -> f32 {
#[cfg(feature = "std")]
{
x.floor()
}
#[cfg(not(feature = "std"))]
{
libm::floorf(x)
}
}
#[inline(always)]
pub fn ceilf(x: f32) -> f32 {
#[cfg(feature = "std")]
{
x.ceil()
}
#[cfg(not(feature = "std"))]
{
libm::ceilf(x)
}
}
#[inline(always)]
pub fn sqrt(x: f64) -> f64 {
#[cfg(feature = "std")]
{
x.sqrt()
}
#[cfg(not(feature = "std"))]
{
libm::sqrt(x)
}
}
#[inline(always)]
pub fn exp(x: f64) -> f64 {
#[cfg(feature = "std")]
{
x.exp()
}
#[cfg(not(feature = "std"))]
{
libm::exp(x)
}
}
}