User Profile

Collapse

Profile Sidebar

Collapse
adonissiu
adonissiu
Last Activity: Aug 28 '07, 09:12 AM
Joined: Jul 11 '07
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • adonissiu
    replied to 0(n^4) complexity
    in C
    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...
    See more | Go to post

    Leave a comment:


  • adonissiu
    replied to Problem with casting a double to int
    in C
    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.
    See more | Go to post

    Leave a comment:


  • adonissiu
    started a topic Problem with casting a double to int
    in C

    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...
    See more | Go to post
No activity results to display
Show More
Working...