你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
sign()
Applies to: ✅ Microsoft Fabric ✅ Azure Data Explorer ✅ Azure Monitor ✅ Microsoft Sentinel
Returns the sign of the numeric expression.
Syntax
sign(
number)
Learn more about syntax conventions.
Parameters
Name | Type | Required | Description |
---|---|---|---|
number | real |
✔️ | The number for which to return the sign. |
Returns
The positive (+1), zero (0), or negative (-1) sign of the specified expression.
Examples
print s1 = sign(-42), s2 = sign(0), s3 = sign(11.2)
Output
s1 | s2 | s3 |
---|---|---|
-1 | 0 | 1 |