Post History
Sandbox
Recreate modulo [cancelled]
#2: Post edited
- Recreate the modulo operation via function or program.
- **Mechanics:**
- - The modulo operator involves division and returns the remainder.
- - For a function, use 2 variables as `foo(a,b)` such that $x \mod y$.
- For a program, take 2 variables as input where `a b` such that $x \mod y$.- - Use standard division and return the remainder without using a built-in modulo operator.
- **Rules:**
- - Standard loopholes are forbidden.
- - Shortest code in bytes wins.
- Recreate the modulo operation via function or program.
- **Mechanics:**
- - The modulo operator involves division and returns the remainder.
- - For a function, use 2 variables as `foo(a,b)` such that $x \mod y$.
- - For a program, take 2 variables as input where `a b` is $x \mod y$.
- - Use standard division and return the remainder without using a built-in modulo operator.
- **Rules:**
- - Standard loopholes are forbidden.
- - Shortest code in bytes wins.
#1: Initial revision
Recreate modulo
Recreate the modulo operation via function or program. **Mechanics:** - The modulo operator involves division and returns the remainder. - For a function, use 2 variables as `foo(a,b)` such that $x \mod y$. - For a program, take 2 variables as input where `a b` such that $x \mod y$. - Use standard division and return the remainder without using a built-in modulo operator. **Rules:** - Standard loopholes are forbidden. - Shortest code in bytes wins.