MCPcopy Create free account
hub / github.com/FirebirdSQL/firebird / evlAtan2

Function evlAtan2

src/jrd/SysFunction.cpp:2182–2210  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2180
2181
2182dsc* evlAtan2(thread_db* tdbb, const SysFunction* function, const NestValueArray& args,
2183 impure_value* impure)
2184{
2185 fb_assert(args.getCount() == 2);
2186
2187 Request* request = tdbb->getRequest();
2188
2189 const dsc* desc1 = EVL_expr(tdbb, request, args[0]);
2190 if (request->req_flags & req_null) // return NULL if desc1 is NULL
2191 return NULL;
2192
2193 const dsc* desc2 = EVL_expr(tdbb, request, args[1]);
2194 if (request->req_flags & req_null) // return NULL if desc2 is NULL
2195 return NULL;
2196
2197 double value1 = MOV_get_double(tdbb, desc1);
2198 double value2 = MOV_get_double(tdbb, desc2);
2199
2200 if (value1 == 0 && value2 == 0)
2201 {
2202 status_exception::raise(Arg::Gds(isc_expression_eval_err) <<
2203 Arg::Gds(isc_sysf_argscant_both_be_zero) << Arg::Str(function->name));
2204 }
2205
2206 impure->vlu_misc.vlu_double = atan2(value1, value2);
2207 impure->vlu_desc.makeDouble(&impure->vlu_misc.vlu_double);
2208
2209 return &impure->vlu_desc;
2210}
2211
2212
2213template <typename ACC, typename F>

Callers

nothing calls this directly

Calls 8

EVL_exprFunction · 0.85
MOV_get_doubleFunction · 0.85
raiseFunction · 0.85
GdsClass · 0.85
StrClass · 0.85
makeDoubleMethod · 0.80
getCountMethod · 0.45
getRequestMethod · 0.45

Tested by

no test coverage detected