Files
freeCodeCamp/guide/arabic/javascript/tutorials/finding-a-remainder-in-javascript/index.md
2018-10-16 21:32:40 +05:30

23 lines
691 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: Finding a Remainder in JavaScript
localeTitle: العثور على البقية في جافا سكريبت
---
يعطي امل الباقي_ `%` الباقي من قسم رقمين.
## مثال
`5 % 2 = 1 because
Math.floor(5 / 2) = 2 (Quotient)
2 * 2 = 4
5 - 4 = 1 (Remainder)
`
## استعمال
في الرياضيات ، يمكن التحقق من الرقم حتى أو فردي عن طريق التحقق من الجزء المتبقي من تقسيم الرقم إلى 2.
`17 % 2 = 1 (17 is Odd)
48 % 2 = 0 (48 is Even)
`
**ملاحظة** لا تخلط بينه وبين _modulus_ `%` لا يعمل بشكل جيد مع الأرقام السالبة.