Why isn't this 255 as expected
# announcements
j
Why isn't this 255 as expected
r
My guess is `UByte`s are converted to `UInt`s for operations, just like `Byte`s are converted to `Int`s.
What a dissapointment, why can't I just have unsigned modular arithmetic!
If I wanted ints I would have used ints.
👍 1
i
You can convert the result back to
UByte
k
Right, and I could have converted the arguments to ints as well, it's just annoying that the default changes type. Adding ints doesn't give longs either, adding longs doesn't give bigint. If I wanted a bigger datatype I would have used that instead.
i
I don't like it either, but that has been made so to be consistent with signed integers
k
Yeah I understand that it's now too late to change and that it needs to be consistent.