compiler-inservice-s22 / Discussion

MIT License
0 stars 0 forks source link

HW5 advance case advExpr #30

Open ChukaChiu opened 2 years ago

ChukaChiu commented 2 years ago

TA們好,

請教HW5的advance case advExpr, 當a=33, b=7時, 為什麼a mod b答案會是5?

是RISC-V的除法為無條件進入法或四捨五入嗎? 還是有其他原因呢?

ypyou commented 2 years ago

In computing, the modulo operation returns the remainder or signed remainder of a division.

ChukaChiu commented 2 years ago

感謝老師, 腦袋一時卡住了, 只記得%不記得mod, 把mod跟div想成一塊去了