MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / AddSqrtDecls

Function AddSqrtDecls

extensions/math_ext_decls.cc:150–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

148}
149
150absl::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
167absl::Status AddFloatingPointDecls(TypeCheckerBuilder& builder) {
168 // Rounding

Callers 1

Calls 8

MakeOverloadDeclFunction · 0.85
OverloadTypeNameFunction · 0.85
AddOverloadMethod · 0.80
IntTypeClass · 0.50
DoubleTypeClass · 0.50
UintTypeClass · 0.50
set_nameMethod · 0.45
AddFunctionMethod · 0.45

Tested by

no test coverage detected