Search:

Type: Posts; User: awsdert

Page 1 of 19 1 2 3 4

Search: Search took 0.01 seconds.

  1. Binary division of vector integer completed

    Created this thread with this title specifically so people searching for binary division for this sort of thing will have something to reference, if you spot any problems however please let me know....
  2. Replies
    1
    Views
    144

    Not quite sure how I managed it but I finally got...

    Not quite sure how I managed it but I finally got that final bit, had corrected some clamping while I was at it, native overflow is detected and matched in behaviour for the sake of the tests,...
  3. Replies
    1
    Views
    144

    1st bit being missed

    I'm not seeing where I went wrong on this so I'm hoping someone here can see it instead.

    Output of the results (r/t) with the values starting off with:


    r = 0b01100001010111111101101110110101,...
  4. Replies
    3
    Views
    278

    I decided I wasn't getting enough info from that...

    I decided I wasn't getting enough info from that output so I made a function to print all the details of a bnum passed to it and shoved a couple of calls to it in bnum_mem_dup() after trying to find...
  5. Replies
    3
    Views
    278

    Ok I found the REAL root of the issue, somehow...

    Ok I found the REAL root of the issue, somehow the values it's supposed to be comparing get overwritten in between passing the comparison, I've just tried dedicated variables and it's still...
  6. Replies
    3
    Views
    278

    Seems it was & wasn't the function, here's the...

    Seems it was & wasn't the function, here's the updated version:


    int bnum_compare( bnum_t const num, bnum_t const val ) {
    int ret, nsb = 0, vsb = 0;
    bit_t n, v;
    PRINT_IF_TRUE( (ret =...
  7. Replies
    3
    Views
    278

    Comparison issues

    Noticed a random comparison error from my function so I redid the function from scratch, seems the error shows up every time now:


    make run (in directory: /media/lee/ZXUIJI_1TB/github/code)
    gcc...
  8. Replies
    0
    Views
    190

    binary division not going well :(

    Relevant output (or at least what I deem relevant, stops at division because result is different from expected so look at bottom to start with):


    ...
    num >= val 0, 0
    comparison( 1649760492,...
  9. Yeah but this time instead of handling variables...

    Yeah but this time instead of handling variables wrong or different than intended it actually did the same thing but skipped a few cycles worth of checking (plus the overhead of calling the...
  10. I managed to fix it somehow, the results got...

    I managed to fix it somehow, the results got screwed up when I tried to call bnum_op_add() apparently,
    I copied & pasted the code from that function into bnum_op_mul(), changed the val related...
  11. Replies
    4
    Views
    299

    Whoops, Me dumb XP, anyway I think xey meant new...

    Whoops, Me dumb XP, anyway I think xey meant new as in new to xem
  12. Struggling to get binary multiplication working

    Here's the segment of code (all safety checks have been done before this)


    for ( v = val.init; v.b < val.width; v = bit_op_inc(v) ) {
    if ( val.value[v.byte] & v.bit )
    (void)bnum_op_add(...
  13. Replies
    4
    Views
    299

    Seems to me to be just automatic stack arrays,...

    Seems to me to be just automatic stack arrays, for example


    Buf a, b;
    a[31][7] = b[0][0];

    takes the last element of the last array in variable a and copies it to the first element of the...
  14. Replies
    7
    Views
    333

    Fixed it, had to change the type of val from...

    Fixed it, had to change the type of val from size_t to ssize_t and add a check for which loop to finish off with:


    int bnum_op_shl_z( bnum_t num, ssize_t val ) {
    int ret = bnum_mem_chk( num );...
  15. Replies
    7
    Views
    333

    Well I did some refinements (with the original...

    Well I did some refinements (with the original functions converted to macros using the below), left shift is working as expected and right shift is ALMOST working as expected but some wierd error...
  16. Replies
    7
    Views
    333

    Fixed it, didn't realise I had been extracting...

    Fixed it, didn't realise I had been extracting bits from wrong variable during the loop stage, here's the changed part:


    int bnum_op_shl( bnum_t num, bnum_t const val ) {
    ...
    while ( mov-- )...
  17. Replies
    7
    Views
    333

    Fixed the wrong variable usage but the problem...

    Fixed the wrong variable usage but the problem remains the same, just different output


    int bnum_op_shl( bnum_t num, bnum_t const val ) {
    int ret = bnum_mem_chk( num );
    size_t mov, bit, i;...
  18. Replies
    7
    Views
    333

    Was looking at my code while waiting to start...

    Was looking at my code while waiting to start work and noticed I used n.bit instead of n.byte to access an array member, this post is just a reminder for me to correct that, might fix the result in...
  19. Replies
    7
    Views
    333

    Was using a switch statement, compiler complained...

    Was using a switch statement, compiler complained when I tried multi-byte characters so I separated the operation testing into separate functions, that character just made it easy to quickly identify...
  20. Replies
    7
    Views
    333

    Struggling to see what I did wrong

    Was doing some checking on my bnum_t functions/math and found a lot of mistakes, I've managed to fix them so far up to this point but now I just can't spot what I did wrong, here's the relevant...
  21. Replies
    7
    Views
    473

    For now I stuck this in: if ( CHEAT_ON_PRINT...

    For now I stuck this in:


    if ( CHEAT_ON_PRINT ) {
    if ( withE )
    (void)sprintf(fpn_txt, "Le", val);
    else
    (void)sprintf(fpn_txt, "lf", val);
    dst->count = (sizeof(ldb) * CHAR_BIT) + 2;...
  22. Replies
    7
    Views
    473

    For now it's being run on a little endian system...

    For now it's being run on a little endian system (linux mint x64), before worrying about the various endians to retieve information from I'm focusing on what to do with the information once I have...
  23. Replies
    7
    Views
    473

    There is A comment, at the point I start...

    There is A comment, at the point I start processing the exponent, as for ill formed what do you mean?
  24. Replies
    7
    Views
    473

    Thanks for the link, read some of it but need to...

    Thanks for the link, read some of it but need to brush up on my math symbols for the other part.
    For now I will put aside the mantissa and ask if I'm handling the exponent correctly:


    typedef...
  25. Replies
    7
    Views
    473

    Probably got this wrong

    Trying to write a function that will convert a long double to a string, here's what I have so far:


    typedef signed char db;
    typedef unsigned char ub;
    typedef signed short dw;
    typedef unsigned...
Results 1 to 25 of 468
Page 1 of 19 1 2 3 4