Complexity of a program describe the dependency of running and number of inputs, say n items.
For example, a m-levels nested loop, if each loop runs n times, the big O notation is O(n^m).
Refer to ur statement, it says that the programmers should avoid writing a program with less nested-loops.
Imagine that, if u search a item from a list with 100items and it has to runs 100^4 = 10000x10000 times, it is...
User Profile
Collapse
-
Thanks for replying, i believe that the problem isn't in
(double )(pQinQplOdds[iOddsCount-1]*100).
And pQinQplOdds is an array of double and
(pQinQplOdds[iOddsCount-1]*100) == 820.00000000 is true.
I believe that the problem is in the casting part.Leave a comment:
-
Problem with casting a double to int
Hi every c++ expert, today i've seen a strange case when i was debugging.
When I cast a double to an int, the value is altered but it doesn't look like neither round up nor round down.
Here is the code:
double temp = (double )(pQinQplOdds[iOddsCount-1]*100); //temp = 820.00000
int odds = static_cast<int >(temp);
odds should get 820 but it doesn't. It turns out getting a value of 819...
No activity results to display
Show More
Leave a comment: