floatToInt8 method

int floatToInt8(
  1. double x
)

Implementation

int floatToInt8(double x) {
  return (x * 255.0).round() & 0xff;
}