---
title: IsFloatingType
description: "判断输入的数据类型是否为浮点类型，包括Float64（即Double）、Float32（即Float）、BFloat16、Float16。"
url: https://www.hiascend.com/document/detail/zh/canncommercial/latest/API/aolapi/atlasascendc_api_07_1156.html
sourcePath: /source/zh/canncommercial/900/API/aolapi/atlasascendc_api_07_1156.html
indexId: 85e2be8a1bfe0b65c31e9e9171305594a7c35a22aeadaf913b694939b9ed7c1e70
---
# IsFloatingType

#### 功能说明

判断输入的数据类型是否为浮点类型，包括Float64（即Double）、Float32（即Float）、BFloat16、Float16。


#### 函数原型

```
bool IsFloatingType(const DataType dtype)
```


#### 参数说明

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


#### 返回值说明

若为浮点类型返回true，否则返回false。


#### 约束说明

无


#### 调用示例

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