嘿嘿,我工作之一就是c++的automated trading system,要是老板发现我用这本书,估计马上炒了我,要是我发现手下的人用这本书,我马上炒了他
try this function on pages 64-65
/*****************************************************************************/
generatePrime: This function computes the smallest prime greater than or equal
to N
[in]: long N : find prime >= N
64 MONTE CARLO SIMULATION
[out]: prime >= N
/*****************************************************************************/
inline long generatePrime(long N)
{
long i = N;
bool flag = false;
do
{
// check if number is prime
if ((i % 2 != 0) && (i % 3 != 0) && (i % 4 != 0) && (i % 5 != 0)
&& (i % 7 != 0) && (i % 8 != 0) && (i % 9 != 0))
flag = true;
else
i++;
}
while (flag != true);
return i;
}
try N = 121,lol...it tells you it's a prime number
DanRen 发表于 2009-6-25 11:34
Wow. you know what, when you need to price a trade at a trading desk which pays $, then you know what saves your hassle.
if you are really working on a trading desk, I love to trade with you, and I believe that will save both of us hassle,...give me a ****ing break