return a random float between lo and hi
| 21 | |
| 22 | // return a random float between lo and hi |
| 23 | float 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. |
| 31 | int main() |