মডুলো ক্যালকুলেটর (a mod n)
এই ক্যালকুলেটর a mod n নির্ণয় করে, অর্থাৎ a কে n দিয়ে ভাগ করলে ভাগশেষ, যেকোনো পূর্ণসংখ্যার জন্য, ঋণাত্মকও। এটি ভাগফল, বিয়োগ এবং গণিতের উত্তর ও কিছু প্রোগ্রামিং ভাষার % অপারেটরের পার্থক্য দেখায়।
ফলাফল
মান দিন এবং ফলাফল দেখতে “হিসাব করুন” চাপুন।
সূত্র
Divide, round down to a whole number, multiply back and subtract. For n > 0 the answer is between 0 and n − 1.
এই ক্যালকুলেটর কীভাবে ব্যবহার করবেন
- Enter the number a and the modulus n (whole numbers; n cannot be 0).
- Press Calculate to see a mod n, the quotient and each step.
সমাধান করা উদাহরণ
17 mod 5
17 ÷ 5 = 3.4, which rounds down to 3.
17 − 5 × 3 = 2, so 17 mod 5 = 2.
−17 mod 5 (a negative number)
−17 ÷ 5 = −3.4, which rounds down to −4.
−17 − 5 × (−4) = 3, so −17 mod 5 = 3. (The % operator in C or JavaScript gives −2.)
100 mod 7
100 ÷ 7 = 14.28…, so the quotient is 14.
100 − 7 × 14 = 2.
সাধারণ ভুল
- Giving the quotient instead of the remainder: 17 mod 5 is 2, not 3.
- Rounding −3.4 to −3 instead of down to −4 for negative numbers.
- Expecting the same answer from % in every programming language; they differ for negatives.
প্রায়ই জিজ্ঞাসিত প্রশ্ন
What does mod mean in math?
a mod n is the remainder when a is divided by n. For example 17 mod 5 = 2, because 17 = 3 × 5 + 2.
How do you calculate mod of a negative number?
Divide and round down (towards negative infinity), then subtract. −17 mod 5: −17 ÷ 5 = −3.4 → −4, and −17 − 5 × (−4) = 3.
Where is modulo used?
Clock arithmetic (14:00 is 2 pm because 14 mod 12 = 2), checking whether a number is even (n mod 2), check digits, and programming.