Search:

Type: Posts; User: cyph1e

Search: Search took 0.01 seconds.

  1. Thread: Logic problem

    by cyph1e
    Replies
    4
    Views
    1,272

    What about double foo(int start, int end) { ...

    What about

    double foo(int start, int end)
    {
    if ( end < start )
    return 0;

    return start + foo(start + 1, end);
    }
  2. Replies
    19
    Views
    2,646

    If you want to be able to calculate "n choose k"...

    If you want to be able to calculate "n choose k" for n or k > 13, using integer arithmatics, you could let P_num be a list of the prime factors of n!, and P_den be a list of the prime factors of...
  3. Replies
    13
    Views
    2,689

    You do realize that (X^(n/2))^2 = X^n and (X *...

    You do realize that (X^(n/2))^2 = X^n and (X * ((X^(n/2))^2)) = X^(n+1)? No need to overcomplicate things. However, if n is an integer, both will be X^n. Are you sure that is not the case? It seems...
  4. Replies
    5
    Views
    4,973

    Doriän, I've spent some time on project euler...

    Doriän, I've spent some time on project euler aswell some time ago. For this problem you don't need to handle 50-digit numbers, in fact, the native types will suffice (if you read the description...
  5. Replies
    21
    Views
    5,154

    How else would you convert it?

    How else would you convert it?
  6. Replies
    6
    Views
    1,297

    Here's an article about it:...

    Here's an article about it: http://www.osix.net/modules/article/?id=792.
  7. Replies
    15
    Views
    2,491

    *((long int *)58112) perhaps?

    *((long int *)58112) perhaps?
  8. Replies
    15
    Views
    2,153

    Why not simply: char * look(char *str, char...

    Why not simply:

    char * look(char *str, char ch)
    {
    while(*str != ch && *str)
    str++;
    return str;
    }
  9. Thread: what is wrong?

    by cyph1e
    Replies
    2
    Views
    945

    for( double t = 0.0 ; t

    for( double t = 0.0 ; t <= pi/2; t += 0.03)
  10. Thread: syntax question

    by cyph1e
    Replies
    19
    Views
    7,350

    It's allright now dear. You've made your point....

    It's allright now dear. You've made your point. Since the last posts here have just been you guys arguing I assume theres no way to do what I wanted in the first place.
  11. Thread: syntax question

    by cyph1e
    Replies
    19
    Views
    7,350

    Ah I see. I thought it was translated like a...

    Ah I see. I thought it was translated like a normal if-statement at compile time. But that explains it. Thanks
  12. Thread: syntax question

    by cyph1e
    Replies
    19
    Views
    7,350

    syntax question

    Hi!

    Is there any way to use 'break', 'continue', and 'return' statements in an if-statement of the form "expr ? t : f"? My compiler complains when I try this.
  13. Replies
    13
    Views
    2,478

    It's simply because the key and message doesn't...

    It's simply because the key and message doesn't have the same length. Use this:
    message[i] = message[i]^key[i%strlen(key)];
  14. Replies
    17
    Views
    2,212

    One example where a do{ ... }while(); loop was...

    One example where a do{ ... }while(); loop was useful for me was when I needed to create a random string which wasn't already present in a database.

    So,

    do {
    //generate string
    //query...
Results 1 to 14 of 14