Cargo Features
[dependencies]
typed_floats = { version = "1.0.2", 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
somewhere in the dependency tree.default-features = false - 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
andno_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 inno_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 thecompiler_hints
feature, and adds a little overhead tonew_unchecked
. This feature can be enabled by any parent crate to ensure no undefined behavior.