operator + method
Adds other
to this number.
If the other
number is double
, the value is truncated after
addition
Returns i64
Implementation
@override
i64 operator +(dynamic other) {
if (other is integer) {
return i64(value + other.value);
} else if (other is int) {
return i64(value + other);
} else if (other is double) {
return i64((value + other).truncate());
} else {
throw Exception('Invalid type for operand: ${other.runtimeType}');
}
}