File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -8293,6 +8293,9 @@ Assignment Operators
8293
8293
&&= ||=
8294
8294
` ` `
8295
8295
8296
+ Note: in V, ` assert -10 % 7 == -3` passes. In programming, the sign of the remainder
8297
+ depends upon the signs of divisor and dividend.
8298
+
8296
8299
# # Other online resources
8297
8300
8298
8301
# ## [V contributing guide](https://github.com/vlang/v/blob/master/CONTRIBUTING.md)
Original file line number Diff line number Diff line change @@ -470,6 +470,8 @@ pub fn (dividend Integer) / (divisor Integer) Integer {
470
470
//
471
471
// WARNING: this method will panic if `divisor == 0`. For a modular division method that
472
472
// returns a Result refer to `mod_checked`.
473
+ // Note: in V, `assert big.integer_from_i64(-10) % big.integer_from_i64(7) == big.integer_from_i64(-3)` passes.
474
+ // In other words, the result is negative 3, and is NOT positive 4.
473
475
@[inline]
474
476
pub fn (dividend Integer) % (divisor Integer) Integer {
475
477
if dividend.signum == - 1 {
You can’t perform that action at this time.
0 commit comments