Cargo Features

[dependencies]
typed_floats = { version = "1.0.1", default-features = false, features = ["compiler_hints", "serde", "std", "libm", "ensure_no_undefined_behavior"] }
default = compiler_hints, std

These default features are set whenever typed_floats is added without default-features = false somewhere in the dependency tree.

compiler_hints default

follows each debug_assert! with core::hint::unreachable_unchecked

serde

Add the serde dependency to enable serialization and deserialization of the types.

Enables serde

std default

Allow to switch between std and no_std environments.

Enables std of typed_floats_macros

Affects traits::Hypot, traits::Copysign, traits::DivEuclid, traits::Atan2, traits::Powf

libm

Add the the num-traits dependency to have access to most math functions in no_std environments.

Enables num-traits, libm of typed_floats_macros

Affects traits::Hypot, traits::Copysign, traits::DivEuclid, traits::Atan2, traits::Powf

ensure_no_undefined_behavior

Will panic! in release mode instead of risking undefined behavior. This will override the compiler_hints feature, and adds a little overhead to new_unchecked. This feature can be enabled by any parent crate to ensure no undefined behavior.