إشعار: يجب
إثبات أهلية جميع المشاريع غير التجارية المسجّلة لاستخدام Earth Engine قبل
15 أبريل 2025 من أجل الحفاظ على إمكانية الوصول إلى Earth Engine.
ee.Number.and
تنظيم صفحاتك في مجموعات
يمكنك حفظ المحتوى وتصنيفه حسب إعداداتك المفضّلة.
تعرض القيمة 1 إذا كانت القيمتان غير صفريتين فقط.
الاستخدام | المرتجعات |
---|
Number.and(right) | العدد |
الوسيطة | النوع | التفاصيل |
---|
هذا: left | العدد | القيمة اليسرى |
right | العدد | القيمة على الجانب الأيسر |
أمثلة
محرّر الرموز البرمجية (JavaScript)
print('Both 5 and 10 are not 0?', ee.Number(5).and(ee.Number(10))); // 1
print('Both 5 and 0 are not 0?', ee.Number(5).and(ee.Number(0))); // 0
إعداد Python
راجِع صفحة
بيئة Python للحصول على معلومات حول واجهة برمجة التطبيقات Python واستخدام
geemap
للتطوير التفاعلي.
import ee
import geemap.core as geemap
Colab (Python)
# 1
print('Both 5 and 10 are not 0?', ee.Number(5).And(ee.Number(10)).getInfo())
# 0
print('Both 5 and 0 are not 0?', ee.Number(5).And(ee.Number(0)).getInfo())
إنّ محتوى هذه الصفحة مرخّص بموجب ترخيص Creative Commons Attribution 4.0 ما لم يُنصّ على خلاف ذلك، ونماذج الرموز مرخّصة بموجب ترخيص Apache 2.0. للاطّلاع على التفاصيل، يُرجى مراجعة سياسات موقع Google Developers. إنّ Java هي علامة تجارية مسجَّلة لشركة Oracle و/أو شركائها التابعين.
تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)
[null,null,["تاريخ التعديل الأخير: 2025-07-26 (حسب التوقيت العالمي المتفَّق عليه)"],[[["\u003cp\u003eThe \u003ccode\u003eand\u003c/code\u003e function returns 1 if both input values are non-zero, and 0 otherwise, essentially acting as a logical 'AND' operator for numbers.\u003c/p\u003e\n"],["\u003cp\u003eIt takes two arguments: a left-hand value (\u003ccode\u003eleft\u003c/code\u003e) and a right-hand value (\u003ccode\u003eright\u003c/code\u003e), both of which should be numbers.\u003c/p\u003e\n"],["\u003cp\u003eYou can access this function on an \u003ccode\u003eee.Number\u003c/code\u003e object by using the \u003ccode\u003e.and()\u003c/code\u003e method in JavaScript or \u003ccode\u003e.And()\u003c/code\u003e in Python to perform a bitwise AND operation.\u003c/p\u003e\n"]]],["The `Number.and()` method checks if two numerical values are non-zero. It takes a `right` numerical value as an argument and implicitly uses a `left` value. The method returns 1 if both the left and right values are non-zero; otherwise, it returns 0. Example code is provided in both JavaScript and Python to demonstrate the function's behavior with non-zero and zero inputs.\n"],null,["# ee.Number.and\n\nReturns 1 if and only if both values are non-zero.\n\n\u003cbr /\u003e\n\n| Usage | Returns |\n|---------------------|---------|\n| Number.and`(right)` | Number |\n\n| Argument | Type | Details |\n|--------------|--------|-----------------------|\n| this: `left` | Number | The left-hand value. |\n| `right` | Number | The right-hand value. |\n\nExamples\n--------\n\n### Code Editor (JavaScript)\n\n```javascript\nprint('Both 5 and 10 are not 0?', ee.Number(5).and(ee.Number(10))); // 1\nprint('Both 5 and 0 are not 0?', ee.Number(5).and(ee.Number(0))); // 0\n```\nPython setup\n\nSee the [Python Environment](/earth-engine/guides/python_install) page for information on the Python API and using\n`geemap` for interactive development. \n\n```python\nimport ee\nimport geemap.core as geemap\n```\n\n### Colab (Python)\n\n```python\n# 1\nprint('Both 5 and 10 are not 0?', ee.Number(5).And(ee.Number(10)).getInfo())\n# 0\nprint('Both 5 and 0 are not 0?', ee.Number(5).And(ee.Number(0)).getInfo())\n```"]]