subset NegativeInt of Int where { $_ < 0 } # I decided to declare it after all subset PositiveInt of Int where { $_ > 0 } sub binary (NegativeInt $n, :$wordsize) { if defined $wordsize { # do 2's complement mode PositiveInt $m= 2 ** $wordsize - $n; return binary($m); } else { return "-" ~ binary(-$n); } }