Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs

Dashboard
Notifications
Mark all as read
Sandbox

Recreate modulo [cancelled]

+0
−0

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.
Why does this post require moderator attention?
You might want to add some details to your flag.

1 comment thread

General comments (6 comments)

This community is part of the Codidact network. We have other communities too — take a look!

You can also join us in chat!

Want to advertise this community? Use our templates!

Like what we're doing? Support us! Donate