You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
5%4===1// Since 5 divided by 4 is 1 with a remainder of 19%4===1// Since 9 divided by 4 is 2 with a remainder of 116%2===0// Since 16 divided by 4 is 8 with a remainder of 0
You do not need to worry about the case when the left or right hand sides are negative.
Template
This is the template for challengers to start the coding. Basically, you just need to change the name of your generic/function and leave to implementation any.
typeModulo<Mextendsnumber,Nextendsnumber>=any
Test Cases
Provide some test cases for your challenge, you can use some utils from @type-challenges/utils for asserting.
Info
Basic info of your challenge questions,
Question
Javascript and a lot of other programming languages support the modulo (also know as remainder) operator
%
which returns the remainder when an integer is divided by another integer. For Javascript's implementation - see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Remainder.Here's some examples:
You do not need to worry about the case when the left or right hand sides are negative.
Template
This is the template for challengers to start the coding. Basically, you just need to change the name of your generic/function and leave to implementation
any
.Test Cases
Provide some test cases for your challenge, you can use some utils from
@type-challenges/utils
for asserting.The text was updated successfully, but these errors were encountered: