MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / rand_float

Function rand_float

compute/example/black_scholes.cpp:23–28  ·  view source on GitHub ↗

return a random float between lo and hi

Source from the content-addressed store, hash-verified

21
22// return a random float between lo and hi
23float rand_float(float lo, float hi)
24{
25 float x = (float) std::rand() / (float) RAND_MAX;
26
27 return (1.0f - x) * lo + x * hi;
28}
29
30// this example demostrates a black-scholes option pricing kernel.
31int main()

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected