Search:

Type: Posts; User: lattica

Search: Search took 0.01 seconds.

  1. Since you don't use i and j in the loops' body,...

    Since you don't use i and j in the loops' body, you don't need nested loops at all.



    for(sidx=0; sidx<72; sidx++)


    As src[sidx] is far away from src[sidx+72] in memory, you're going to get...
  2. Replies
    35
    Views
    7,744

    S = 3*(x1+x2+..)+xk and we want to find k. ...

    S = 3*(x1+x2+..)+xk

    and we want to find k.

    Loop through the array again but subtract 3*xi from S
    if i != k then (S-3*xi)%3 == xk
    if i == k then (S-3*xi)%3 == -2*xk

    So, in the first...
  3. Replies
    6
    Views
    1,044

    So, what you want to do is put the lowest bit of...

    So, what you want to do is put the lowest bit of 0x42 into the highest of an
    intermediary, unsigned byte. Put the top half of 0xF0 into the next four bits. And as the
    five right-most bits make up...
  4. Replies
    6
    Views
    1,044

    sample_rate = sample_rate & 0xFFFFF0 Right...

    sample_rate = sample_rate & 0xFFFFF0

    Right shift by 4 is what you need to do here.
  5. Replies
    2
    Views
    3,254

    Alternatively, you could think of the string as a...

    Alternatively, you could think of the string as a number in base 26 then convert to base 10 and back in the usual ways. Of course, this limits the allowed length of words, e.g., for uint32 the limit...
  6. Replies
    6
    Views
    1,331

    Don't you mean every multiple of 4? If so, using...

    Don't you mean every multiple of 4? If so, using the not operator will help you get those zeroes. ;)
  7. Replies
    12
    Views
    3,537

    You could search mathworld for 'Square Root...

    You could search mathworld for 'Square Root Algorithms.' There are a few methods described there for finding square roots.
  8. Replies
    14
    Views
    1,532

    I see; you have misread the code snippet I posted...

    I see; you have misread the code snippet I posted above.
  9. Replies
    14
    Views
    1,532

    Quzah, please elaborate.

    Quzah, please elaborate.
  10. Replies
    14
    Views
    1,532

    The [i][j] syntax can be recovered by allocating...

    The [i][j] syntax can be recovered by allocating an array of pointers, as well as the linear chunk, and setting each of these to point to each row:



    char *outputWindowArray;
    char...
  11. Replies
    65
    Views
    6,974

    "...Accept certain inalienable truths: prices...

    "...Accept certain inalienable truths: prices will rise, politicians will philander..."

    There's nothing new about the news.
  12. Replies
    4
    Views
    2,451

    Yes. The left most bit indicates the sign and...

    Yes. The left most bit indicates the sign and when right shifting, the word may be filled with whatever the bit was--though, I think that's implementation defined.
  13. Replies
    4
    Views
    2,451

    Try changing int to unsigned int everywhere, and...

    Try changing int to unsigned int everywhere, and %d to %u.
  14. Thread: Double check

    by lattica
    Replies
    2
    Views
    1,737

    Google 'strtod.'

    Google 'strtod.'
  15. Thread: text editor

    by lattica
    Replies
    5
    Views
    1,639

    It was a trick question and you've given the full...

    It was a trick question and you've given the full solution. tsk tsk
  16. Replies
    11
    Views
    1,536

    Why not read the number as a string of digits?

    Why not read the number as a string of digits?
Results 1 to 16 of 16