Function |to_i32

conv/f32::|to_i32


Usage

|to_i32(value, pos_infinity, neg_infinity, nan)

Parameters

↳ value: f32
↳ pos_infinity: i32
↳ neg_infinity: i32
↳ nan: i32

Return

i32


Turns f32 into i32.

f32 is truncated to fit into i32, and in case floating-point value does not describe a real number:

  • pos_infinity is used when f32 is a positive infinity,
  • neg_infinity is used when f32 is a negative infinity,
  • nan is used when f32 is not a number.