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

Function evlExp

src/jrd/SysFunction.cpp:4282–4316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4280
4281
4282dsc* evlExp(thread_db* tdbb, const SysFunction*, const NestValueArray& args,
4283 impure_value* impure)
4284{
4285 fb_assert(args.getCount() == 1);
4286
4287 Request* request = tdbb->getRequest();
4288
4289 const dsc* value = EVL_expr(tdbb, request, args[0]);
4290 if (request->req_flags & req_null) // return NULL if value is NULL
4291 return NULL;
4292
4293 if (value->isDecOrInt128())
4294 {
4295 DecimalStatus decSt = tdbb->getAttachment()->att_dec_status;
4296 impure->vlu_misc.vlu_dec128 = MOV_get_dec128(tdbb, value);
4297
4298 Decimal128 e;
4299 e.set("2.718281828459045235360287471352662497757", decSt);
4300 impure->vlu_misc.vlu_dec128 = e.pow(decSt, impure->vlu_misc.vlu_dec128);
4301 impure->vlu_desc.makeDecimal128(&impure->vlu_misc.vlu_dec128);
4302 }
4303 else
4304 {
4305 const double rc = exp(MOV_get_double(tdbb, value));
4306 if (rc == HUGE_VAL) // unlikely to trap anything
4307 status_exception::raise(Arg::Gds(isc_arith_except) << Arg::Gds(isc_exception_float_overflow));
4308 if (std::isinf(rc))
4309 status_exception::raise(Arg::Gds(isc_arith_except) << Arg::Gds(isc_exception_float_overflow));
4310
4311 impure->vlu_misc.vlu_double = rc;
4312 impure->vlu_desc.makeDouble(&impure->vlu_misc.vlu_double);
4313 }
4314
4315 return &impure->vlu_desc;
4316}
4317
4318
4319dsc* evlFirstLastDay(thread_db* tdbb, const SysFunction* function, const NestValueArray& args,

Callers

nothing calls this directly

Calls 14

EVL_exprFunction · 0.85
MOV_get_dec128Function · 0.85
MOV_get_doubleFunction · 0.85
raiseFunction · 0.85
GdsClass · 0.85
isinfFunction · 0.85
isDecOrInt128Method · 0.80
powMethod · 0.80
makeDecimal128Method · 0.80
makeDoubleMethod · 0.80
getCountMethod · 0.45
getRequestMethod · 0.45

Tested by

no test coverage detected