`unative`: native integer type for arithmetic

⚓ Rust    📅 2026-05-23    👤 surdeus    👁️ 2      

surdeus

Following the discussion about native integer types here and here, I have published a crate unative that defines such a type.

@vigna might be interested.

The concept of "native integer type" has no unambiguous definition, but we try to choose the largest width for which the target supports efficient hardware arithmetic, including multiplication and division.

Often this is the same width as usize , but not always. For example, on x86_64-unknown-linux-gnux32 , usize is 32 bits and UNative is 64 bits.

1 post - 1 participant

Read full topic

🏷️ Rust_feed