---
title: IsRealNumberType
description: "判断输入的数据类型，是否只包含实部数字类型。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/aolapi/atlasascendc_api_07_1097.html
sourcePath: /source/zh/canncommercial/900/API/aolapi/atlasascendc_api_07_1097.html
indexId: bfc7b16ffc8b5d17f183df695fb64e128c8547934a353e1baeda926638d6b9bb70
---
# IsRealNumberType

#### 功能说明

判断输入的数据类型，是否只包含实部数字类型。


#### 函数原型

```
bool IsRealNumberType(const DataType dtype)
```


#### 参数说明

| 参数 | 输入/输出 | 说明 |
| --- | --- | --- |
| dtype | 输入 | 输入数据类型，判断该类型是否仅包含实部。 实部数字类型包括：Float64、Float32、Float16、Int16、Int32、Int64、Int8、UInt16、UInt32、UInt64、UInt8、BFloat16。 |


#### 返回值说明

输入数据类型只包含实部时，返回true，否则返回false。


#### 约束说明

无


#### 调用示例

```
// 判断dtype不只包含实部时，返回
void Func(const DataType dtype) {
    if (!IsRealNumberType(dtype)) {
        return;
    }
}
```
