Cargo Features

half = { version = "2.3.1", default-features = false, features = ["std", "use-intrinsics", "alloc", "rand_distr", "bytemuck", "serde", "num-traits", "zerocopy"] }
default = std

The std feature is set by default whenever half is added without default-features = false somewhere in the dependency tree.

std default = alloc

Affects slice::HalfFloatSliceExt.to_f32_vec



alloc std

Affects half::vec, slice::HalfFloatSliceExt.to_f64_vec, slice::HalfFloatSliceExt.to_f32_vec


Enables rand and rand_distr

Features from optional dependencies

In crates that don't use the dep: syntax, optional dependencies automatically become Cargo features.

bytemuck implicit feature

With derive

serde implicit feature

With derive

num-traits implicit feature

With libm

zerocopy implicit feature

Enables zerocopy ^0.6.0