Search:

Type: Posts; User: Zacariaz

Page 1 of 3 1 2 3

Search: Search took 0.01 seconds.

  1. Replies
    9
    Views
    1,643

    So a^(a^-b) == a^(1/(a^b)) Didn't think of...

    So a^(a^-b) == a^(1/(a^b))

    Didn't think of that, even though it's quite obvious.

    Anyway, I believe this thread has run it's course.


    So long and thanks for all the fish.
  2. Replies
    9
    Views
    1,643

    hmm, that's actually true, how odd I didn't think...

    hmm, that's actually true, how odd I didn't think of that. I knew of course that we would quickly get up there, but eh, that actually solves the problem pretty well, not that there was a problem in...
  3. Replies
    9
    Views
    1,643

    'n' usually, as I understand it anyway, signify...

    'n' usually, as I understand it anyway, signify that it's a natural number, that is an integer >= 0. My apologies for not specifying. Furthermore the value in this case will never surpass 15, though...
  4. Replies
    9
    Views
    1,643

    Can 2^(2^n) - 1 be simplified?

    As the title describes, I've got this annoying little piece of math:
    2^(2^n) - 1

    And while from a programming perspective it's really not that involved:
    (1<<(1<<n))-1

    I still have to wonder...
  5. Well, firstly, it's hard to help without any hint...

    Well, firstly, it's hard to help without any hint as to what wrong, no explanatory comments, and so on and so forth.
    Further more, you using iostream is really C++.

    Although I've never seen that...
  6. Replies
    7
    Views
    983

    Thanks.

    Thanks.
  7. Replies
    7
    Views
    983

    I am sorry if I was a bit harsh, and of course it...

    I am sorry if I was a bit harsh, and of course it is true that I did not specify that I was not developing on arm, or mips, or whatever platform you desire. I suspected that people would assume a...
  8. Replies
    7
    Views
    983

    Okay, and why is that? I'm not developing on arm...

    Okay, and why is that? I'm not developing on arm and have no need for my code to be ultra portable. I would like it to work on on the x86 platform, and that's basically it, thus significantly more...
  9. Replies
    7
    Views
    983

    The square root of all evil...

    In short, I need to take the square root of an unsigned integer, and am perfectly happy with a floored integer return value, in fact it's preferred. Also it need to work with 64 bit integers.

    It...
  10. Of course. Thanks for the swift reply.

    Of course. Thanks for the swift reply.
  11. A matter of interest: if( a || b ) vs. if( a | b )

    In short

    if( a || b )
    if( a | b )

    The two examples, I suspect even if a and b are naughty types, should give the same result in this context, as a true statement is defined (AFAIK) as a...
  12. Replies
    12
    Views
    1,058

    Last one, I promise... #include ...

    Last one, I promise...


    #include <stdint.h>
    #define R_T uint8_t
    #define R_WIDTH ( sizeof ( R_T ) * 8 )


    inline R_T rotate( R_T b, unsigned int i )
    {
  13. Replies
    12
    Views
    1,058

    Or what about this overly complicated one liner,...

    Or what about this overly complicated one liner, complete with error checking? ;)
    The first value is the byte you wish to rotate, and the second is by how much. if 'i' is 0, you it will return the...
  14. Replies
    12
    Views
    1,058

    Ah, know I think I know what you mean. This: ...

    Ah, know I think I know what you mean.

    This:

    union
    { struct
    {
    uint8_t a:4, b:4;
    } bitFields;
    uint8_t c;
  15. Replies
    10
    Views
    2,466

    I think it's word asking what you're going to do...

    I think it's word asking what you're going to do with these numbers, how they're generated and so forth, as it's perfectly possible that you can get away with only representing their components, like...
  16. sqrt(n) is need for large 64 bit primes: ...

    sqrt(n) is need for large 64 bit primes:


    uint_fast32_t isPrime(unsigned long long n){
    if( n == 2 ) return 1;
    else if( !( n % 2ull ) || n < 2 ) return 0;
    uint_fast32_t sqp = sqrt(...
  17. One of several mistakes already corrected. ;) ...

    One of several mistakes already corrected. ;)

    Of course p*p <= n

    I've also inverted the initialization process, thus setting bits instead of resetting them, thus saving, I thing, one...
  18. To those who might be interested, here's the...

    To those who might be interested, here's the primarity checker function in it's current form. Seems to work.


    uint_fast32_t isPrime(unsigned long long n)
    {
    unsigned long long p = 3;
    ...
  19. Can I decrease run time / initialization time with threads?

    I wrote this small piece of code yesterday for the fun of it, after which I set my self a challenge, mainly to do everything in my power to bring down the initialization time, what was initially 40...
  20. Replies
    5
    Views
    871

    Thanks for the input. it does of course make...

    Thanks for the input. it does of course make sense that you need to analyse the data before compressing it, I had just hoped there were some methods I hadn't heard of.
  21. Replies
    0
    Views
    804

    Just can't find the problem.

    edit: found the problem.

    Since I had nothing better to do, I thought I'd play around with some prime numbers, but there's a problem...

    It gives me 3, 5, 7 and 11 just fine, then it skips 13 and...
  22. Replies
    5
    Views
    871

    Pretty much the conclusion I arrived at my self,...

    Pretty much the conclusion I arrived at my self, but I suppose that if compression where to be implemented, if say to don't wan't to wait for the prime number generator to initialize, and don't want...
  23. Replies
    5
    Views
    871

    Data compression options

    Several times now, I've found my self in the situation where I needed to handle massive amounts of data, and it was almost too much, and I've also had an idea or two, which have simply not been...
  24. Replies
    2
    Views
    573

    Seems right to me, apart from those scanf...

    Seems right to me, apart from those scanf newlines.

    Anyway, as before mentioned, do explain what exactly is going wrong.
  25. Replies
    6
    Views
    622

    When assigning values, shouldn't you simply be...

    When assigning values, shouldn't you simply be able to do *board[n] = num?

    I'm a bit rusty, so I may be completely wrong.
Results 1 to 25 of 66
Page 1 of 3 1 2 3