Fixed a problem that "Random" doesn't return the HighBound value in CALC measure.

This commit is contained in:
spx 2010-04-08 23:47:52 +00:00
parent 32db892e2c
commit 4cf4a84afb

View File

@ -154,7 +154,7 @@ void CMeasureCalc::RandomFormulaReplace()
{
if (wcsnicmp(L"Random", m_Formula.c_str() + loc, 6) == 0)
{
int range = (m_HighBound - m_LowBound);
int range = (m_HighBound - m_LowBound) + 1;
srand((unsigned) rand());
int randNumber = m_LowBound + (range * rand()/(RAND_MAX + 1.0));