---
title: sign
description: "符号函数，根据输入数字的符号返回1或-1。"
url: https://www.hiascend.com/document/detail/zh/Atlas200IDKA2DeveloperKit/latest/Application%20Development%20Guide/msadg/mxvisionug_0367.html
sourcePath: /source/zh/Atlas200IDKA2DeveloperKit/23.0.RC2/Application Development Guide/msadg/mxvisionug_0367.html
indexId: ed36884f5133b1e72f17480128c2d681f903930a0026f2bb6694e0c1e619e4b7102
---
# sign

#### 函数功能

符号函数，根据输入数字的符号返回1或-1。


#### 函数原型

```
inline flot sign(float x);
```


#### 参数说明

| 参数名 | 输入/输出 | 说明 |
| --- | --- | --- |
| x | 输入 | 待判断符号的数字。 |
