Closed MaisaMilena closed 3 years ago
I'll try implementing Pos32.dot
I'd like to try implementing Bits.mul as well.
I'd like to try implementing Bits.sub, Bits.div and Bits.mod, but I have a couple of questions about how that should be done:
What is the expected behavior for Bits.sub(a, b) when b > a?
What is the expected behavior for Bits.div(a, b)/Bits.mod(a, b) when b is zero?
EDIT: It seems to be common to return 0 in all these cases, so that's how I'm implementing them.
Moved to Formality repo
Bits
Hint By just googling "binary addition" (or multiplication, division) etc. we can find some simple algorithms
Word
F64
Pos32
String
Others