I see Roc's standard library has Num.rem
, which seems equivalent to Rust's rem
function.
https://www.roc-lang.org/builtins/Num#rem
https://doc.rust-lang.org/std/primitive.u8.html#method.rem-2
is there a "modulo" function, like Rust's rem_euclid
?
https://doc.rust-lang.org/core/primitive.i8.html#method.rem_euclid
This is being discussed in another thread https://roc.zulipchat.com/#narrow/stream/304641-ideas/topic/Add.20mod.20to.20the.20builtins/near/394738507
Becker A. has marked this topic as resolved.
Richard Feldman said:
so the idea would be to remove the current mod/rem operations from builtins, as well as the
%
operator, and replace them all with:Num.mod : Num a, [Signed, Unsigned, Euclidean] -> Num a
Looks like the summary
Last updated: Jul 06 2025 at 12:14 UTC