operator * method

  1. @override
u8 operator *(
  1. dynamic other
)
override

Multiplies this integer by other.

If the other number is double, the value is truncated after multiplication

Returns u8

Implementation

@override
u8 operator *(dynamic other) {
  if (other is integer) {
    return u8(value * other.value);
  } else if (other is int) {
    return u8(value * other);
  } else if (other is double) {
    return u8((value * other).truncate());
  } else {
    throw Exception('Invalid type for operand: ${other.runtimeType}');
  }
}