Check whether the type or any of its children is a float type.
| 102 | |
| 103 | // Check whether the type or any of its children is a float type. |
| 104 | bool ContainsFloatType(const DataType& type) { |
| 105 | if (is_floating(type.id())) { |
| 106 | return true; |
| 107 | } else { |
| 108 | // Check if any nested field contains a float type. |
| 109 | for (const auto& field : type.fields()) { |
| 110 | if (ContainsFloatType(*field->type())) { |
| 111 | return true; |
| 112 | } |
| 113 | } |
| 114 | } |
| 115 | // No float types are observed |
| 116 | return false; |
| 117 | } |
| 118 | |
| 119 | } // namespace |
| 120 |
no test coverage detected