We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 667142f commit cd0b2c3Copy full SHA for cd0b2c3
1 file changed
std/math/big/int.jule
@@ -259,6 +259,15 @@ impl Int {
259
self.neg = len(self.abs) > 0 && x.neg != y.neg // 0 has no sign
260
}
261
262
+ // Sets self to the remainder x%y for y != 0.
263
+ // If y == 0, a division-by-zero run-time panic occurs.
264
+ // Implements truncated modulus (like Jule); see [Int.QuoRem] for more details.
265
+ fn Rem(mut *self, &x: *Int, &y: *Int) {
266
+ mut q := []Word(nil)
267
+ divW(&q, &self.abs, x.abs, y.abs)
268
+ self.neg = len(self.abs) > 0 && x.neg // 0 has no sign
269
+ }
270
+
271
// Sets self to the quotient x/y for y != 0.
272
// If y == 0, a division-by-zero runtime panic occurs.
273
// Implements Euclidean division; see [Int.DivMod] for more details.
0 commit comments