---
title: IsComplexType
description: "判断输入的数据类型是否为复数类，包括Complex128、Complex64、Complex32。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/aolapi/atlasascendc_api_07_1155.html
sourcePath: /source/zh/canncommercial/900/API/aolapi/atlasascendc_api_07_1155.html
indexId: 48af2fab3e124435fe98353b51525ade2deb1ea52362fe8ec90e1d040a4a93f870
---
# IsComplexType

#### 功能说明

判断输入的数据类型是否为复数类，包括Complex128、Complex64、Complex32。


#### 函数原型

```
bool IsComplexType(const DataType dtype)
```


#### 参数说明

| 参数 | 输入/输出 | 说明 |
| --- | --- | --- |
| dtype | 输入 | 输入的数据类型。 |


#### 返回值说明

若输入的数据类型为复数类型返回true，否则返回false。


#### 约束说明

无


#### 调用示例

```
// 判断dtype不为复数类型时，返回
void Func(const DataType dtype) {
    if (!IsComplexType(dtype)) {
        return;
    }
}
```
