MCPcopy Create free account
hub / github.com/NVIDIA/cuda-samples / randData

Function randData

cpp/5_Domain_Specific/binomialOptions/binomialOptions.cpp:65–69  ·  view source on GitHub ↗

/////////////////////////////////////////////////////////////////////////// Helper function, returning uniformly distributed random float in [low, high] range ///////////////////////////////////////////////////////////////////////////

Source from the content-addressed store, hash-verified

63// random float in [low, high] range
64////////////////////////////////////////////////////////////////////////////////
65real randData(real low, real high)
66{
67 real t = (real)rand() / (real)RAND_MAX;
68 return ((real)1.0 - t) * low + t * high;
69}
70
71////////////////////////////////////////////////////////////////////////////////
72// Main program

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected