Function artichoke_backend::convert::float_to_int

source ·
pub fn float_to_int(float: f64) -> Result<i64, Error>
Expand description

Convert a f64 to an i64 by rounding toward zero.

§Errors

This function can return either a FloatDomainError or a RangeError.

FloatDomainError is returned if the input is either NaN or infinite.

RangeError is returned if the input is finite but out of range of i64::MIN..=i64::MAX.