IsRealNumberType
Description
Checks whether the input data type contains only a real number.
Prototype
bool IsRealNumberType(const DataType dtype)
Parameters
Parameter |
Input/Output |
Description |
|---|---|---|
dtype |
Input |
Input data type, which is used to determine whether the type contains only a real number. The numeric types with a real number include Float64, Float32, Float16, Float8_E5M2, Float8_E4M3FN, Float8_E8M0, Float6_E3M2, Float6_E2M3, Float4_E2M1, Float4_E1M2, HiFloat8, Int16, Int32, Int64, Int8, UInt16, UInt32, UInt64, UInt8, and BFloat16. |
Returns
If the input data type contains only a real number, true is returned. Otherwise, false is returned.
Constraints
None
Examples
1 2 3 4 5 6 | // If the data type contains more than a real number, a return statement is executed. void Func(const DataType dtype) { if (!IsRealNumberType(dtype)) { return; } } |
Parent topic: data_type_utils