Function std::intrinsics::float_to_int_unchecked[][src]

pub unsafe extern "rust-intrinsic" fn float_to_int_unchecked<Float, Int>(
    value: Float
) -> Int where
    Int: Copy,
    Float: Copy
🔬 This is a nightly-only experimental API. (core_intrinsics)

intrinsics are unlikely to ever be stabilized, instead they should be used through stabilized interfaces in the rest of the standard library

Expand description

使用 LLVM 的 fptoui/fptosi 进行转换,对于越界的值可能会返回 undef (https://github.com/rust-lang/rust/issues/10184)

稳定为 f32::to_int_uncheckedf64::to_int_unchecked