Function |to_u8

conv/f64::|to_u8


Usage

|to_u8(value, pos_infinity, neg_infinity, nan)

Parameters

↳ value: f64
↳ pos_infinity: u8
↳ neg_infinity: u8
↳ nan: u8

Return

u8


Turns f64 into u8.

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

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