---
title: IsIntegralType（含bool）
description: "判断输入的数据类型是否为整数类型，包括Int8、Int16、Int32、Int64、Uint8、Uint16、Uint32、Uint64。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/aolapi/atlasascendc_api_07_1158.html
sourcePath: /source/zh/canncommercial/900/API/aolapi/atlasascendc_api_07_1158.html
indexId: d4de68b5f49e8f4ade127655d2cf2280477bede1f559eb586a15e7f365fba7d270
---
# IsIntegralType（含bool）

#### 功能说明

判断输入的数据类型是否为整数类型，包括Int8、Int16、Int32、Int64、Uint8、Uint16、Uint32、Uint64。

若include_bool置为true，那么bool也被认为是整数。


#### 函数原型

```
bool IsIntegralType(const ge::DataType type, const bool include_bool)
```


#### 参数说明

| 参数 | 输入/输出 | 说明 |
| --- | --- | --- |
| type | 输入 | 输入的数据类型。 |
| include\_bool | 输入 | 是否将bool视为整数类型。 |


#### 返回值说明

若为整数类型返回true，否则返回false。


#### 约束说明

无


#### 调用示例

```
// 判断dtype不为整数类型时，返回，注意bool也是整数类型
void Func(const ge::DataType type) {
    if (!IsIntegralType(type, true)) {
        return;
    }
}
```
