Check whether the type or any of its children is a float type.
| 110 | |
| 111 | // Check whether the type or any of its children is a float type. |
| 112 | bool ContainsFloatType(const DataType& type) { |
| 113 | if (is_floating(type.id())) { |
| 114 | return true; |
| 115 | } else { |
| 116 | // Check if any nested field contains a float type. |
| 117 | for (const auto& field : type.fields()) { |
| 118 | if (ContainsFloatType(*field->type())) { |
| 119 | return true; |
| 120 | } |
| 121 | } |
| 122 | } |
| 123 | // No float types are observed |
| 124 | return false; |
| 125 | } |
| 126 | |
| 127 | } // namespace |
| 128 |
no test coverage detected