freeCodeCamp/guide/arabic/javascript/tutorials/finding-a-remainder-in-java.../index.md

23 lines
691 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

---
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_ `%` لا يعمل بشكل جيد مع الأرقام السالبة.