TIL that the % operator in Swift is a remainder operator and not a true modulo operator. I expected -1 % 7
to return 6
, but it returns -1
.
Mark Pospesel (Coding and Other Stuff)
Coding, tech, living abroad, travel, hiking, vintage plastic bricks
TIL that the % operator in Swift is a remainder operator and not a true modulo operator. I expected -1 % 7
to return 6
, but it returns -1
.