Search:

Type: Posts; User: Govalant

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    10
    Views
    1,531

    Right, i was thinking kind of the opposite. If...

    Right, i was thinking kind of the opposite. If both MSB are 0 there will be no overflow.
  2. Replies
    10
    Views
    1,531

    There will be an overflow only if both "most...

    There will be an overflow only if both "most significant bits" are 1.

    (in your case, that's the 3rd bit from the right)

    http://en.wikipedia.org/wiki/Most_significant_bit


    EDIT: Sorry, that...
  3. Replies
    17
    Views
    3,382

    It's not O(n) either, you can't know how the...

    It's not O(n) either, you can't know how the algorithm will behave, for now, all i know is that if n is a power of 2, the complexity will be O(log2(n))

    I'm coding something right now to analyze...
  4. Replies
    17
    Views
    3,382

    The complexity of the 3n + 1 algorithm is not...

    The complexity of the 3n + 1 algorithm is not O(3n + 1)
  5. Replies
    17
    Views
    3,382

    But you still need to check all the numbers to...

    But you still need to check all the numbers to find the maximum.

    So it would the complexity of all the numbers (n) multiplied by the complexity of running the 3n+1 algorithm.

    And for what i...
  6. Thread: new student

    by Govalant
    Replies
    5
    Views
    1,228

    Lol all of his threads are titled "new student"

    Lol all of his threads are titled "new student"
  7. Replies
    6
    Views
    2,947

    Okey i'll look it up. So in *nix it isn't...

    Okey i'll look it up.

    So in *nix it isn't possible? :O
  8. Replies
    6
    Views
    2,947

    Run in background - No console

    Is there a way to make a program run in the background?

    Because every program i make pop ups the console.
  9. Replies
    1
    Views
    57,539

    you used variables with the same name than...

    you used variables with the same name than functions.

    don't do that. Always use different names, for the function you could use something like "farTocel", and the vars are far and cel.
  10. Replies
    9
    Views
    3,921

    15 secons to read thw whole file, which is 114MB

    15 secons to read thw whole file, which is 114MB
  11. Replies
    5
    Views
    1,044

    I don't see anything wrong. But why did you...

    I don't see anything wrong.

    But why did you use


    *(myArray + (i-1)) = temp;

    when you could have used:
  12. Replies
    9
    Views
    3,921

    This is the only part executing at the time,...

    This is the only part executing at the time, besides i used some printf's to count the amount of numbers introduced.

    Even set() is nothing really.


    void set(char T[],int n)
    {
    T[n/8] &=...
  13. Replies
    9
    Views
    3,921

    while((c=getc(i)) != EOF) { ...

    while((c=getc(i)) != EOF)
    {
    if(isdigit(c))
    {
    t = (t*10) + c - '0';
    } else {

    if(t<x*8000000)
    {
    ...
  14. Replies
    9
    Views
    3,921

    But it's really slow, like 1000 int in 3 seconds....

    But it's really slow, like 1000 int in 3 seconds.

    I'm doing the sort-on-disk problem of programming pearls by the way.
  15. Replies
    9
    Views
    3,921

    Reading Input from file (Integer array)

    How can i read a file, which consists on about 10M integers separated by \n.

    I don't know how to use fscanf and i tried reading char by char and converting to int, but it's too slow.

    Thanks.
  16. you need to include stdlib. maybe in some...

    you need to include stdlib.

    maybe in some other compiler it included it automaticaly.
  17. Thread: fopen problem

    by Govalant
    Replies
    6
    Views
    1,325

    strcat doesn't return the string. It adds the...

    strcat doesn't return the string.
    It adds the second to the first

    do something like



    char* t;
    t=malloc(strlen(loadDir)+strlen("personscan.txt")+1);
    strcpy(t,loadDir);
  18. Replies
    11
    Views
    17,649

    First of all, i think your formula is upside...

    First of all, i think your formula is upside down.

    Second, your printf should be


    printf ("the Farenheit is &#37;f",F);

    instead of
  19. Replies
    6
    Views
    1,319

    ch goes from -128 to 127 aaa from -2 to 1 bbb...

    ch goes from -128 to 127
    aaa from -2 to 1
    bbb from -4 to 3
  20. Replies
    8
    Views
    1,397

    printf("The mean of the three numbers you entered...

    printf("The mean of the three numbers you entered is&#37;i", mean);

    You're using %i, it should be %lf. McGyver told you the same earlier.
  21. Replies
    8
    Views
    1,397

    printf and scanf both use f for float and lf for...

    printf and scanf both use f for float and lf for double.
  22. Replies
    7
    Views
    1,627

    Exactly =)

    Exactly =)
  23. Replies
    7
    Views
    1,627

    multi_tile will be 1 only if norec is different...

    multi_tile will be 1 only if norec is different than zero and opt_DM is less than 32.

    if those conditions are not true multi_tile will be zero.

    Boolean expresions evaluate to 1 or 0, indicating...
  24. Replies
    8
    Views
    1,086

    don't use unsigned, it just creates trobules. ...

    don't use unsigned, it just creates trobules.

    in some cases


    unsigned int a = 5;
    int b = 5;


    a==b is not true.
  25. Replies
    7
    Views
    1,627

    When you don't specifiy a condition it evaluates...

    When you don't specifiy a condition it evaluates to true if it is different than zero so phase[i] and phase[i]!=0 are the same thing when already compiled.

    And that loop will run while the string...
Results 1 to 25 of 58
Page 1 of 3 1 2 3