| 148 | } |
| 149 | |
| 150 | absl::Status AddSqrtDecls(TypeCheckerBuilder& builder) { |
| 151 | const Type kNumerics[] = {IntType(), DoubleType(), UintType()}; |
| 152 | |
| 153 | FunctionDecl sqrt_decl; |
| 154 | sqrt_decl.set_name("math.sqrt"); |
| 155 | |
| 156 | for (const Type& type : kNumerics) { |
| 157 | CEL_RETURN_IF_ERROR(sqrt_decl.AddOverload( |
| 158 | MakeOverloadDecl(absl::StrCat("math_sqrt_", OverloadTypeName(type)), |
| 159 | DoubleType(), type))); |
| 160 | } |
| 161 | |
| 162 | CEL_RETURN_IF_ERROR(builder.AddFunction(sqrt_decl)); |
| 163 | |
| 164 | return absl::OkStatus(); |
| 165 | } |
| 166 | |
| 167 | absl::Status AddFloatingPointDecls(TypeCheckerBuilder& builder) { |
| 168 | // Rounding |
no test coverage detected