Digit constructor

Digit(
  1. int num
)

Constructs a digit that matches the value of num.

Implementation

Digit(int num) {
  if (num > 9 || num < 0) {
    throw Exception('Digit must be between 0 and 9, inclusive ($num)');
  }
  value.setUint8(0, num);
}