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

Function evlRand

src/jrd/SysFunction.cpp:6207–6220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6205
6206
6207dsc* evlRand(thread_db* tdbb, const SysFunction*, const NestValueArray& args,
6208 impure_value* impure)
6209{
6210 fb_assert(args.getCount() == 0);
6211
6212 SINT64 n;
6213 tdbb->getAttachment()->att_random_generator.getBytes(&n, sizeof(n));
6214 n &= QUADCONST(0x7FFFFFFFFFFFFFFF); // remove the sign
6215
6216 impure->vlu_misc.vlu_double = (double) n / (double) MAX_SINT64;
6217 impure->vlu_desc.makeDouble(&impure->vlu_misc.vlu_double);
6218
6219 return &impure->vlu_desc;
6220}
6221
6222
6223dsc* evlReplace(thread_db* tdbb, const SysFunction*, const NestValueArray& args,

Callers

nothing calls this directly

Calls 4

makeDoubleMethod · 0.80
getCountMethod · 0.45
getBytesMethod · 0.45
getAttachmentMethod · 0.45

Tested by

no test coverage detected