Search:

Type: Posts; User: AamirYousafi

Search: Search took 0.00 seconds.

  1. Tool for testing exactly the performance of program / algorithm

    With today's modern computers, for novice programmers who write mostly small programs, it's not possible to tell which program / algorithm performs better. Is there a tool that measures CPU load...
  2. Replies
    25
    Views
    34,320

    Just as a final tidbit on this subject, after a...

    Just as a final tidbit on this subject, after a bit of testing, I found that __float128 is printing 34 digits accurately, double is printing 17 digits accurately, and float is printing 7 digits...
  3. Replies
    25
    Views
    34,320

    Aah! I did know about the 6 digits of precision...

    Aah! I did know about the 6 digits of precision of float and the 15 digits of double, but I did not know about the 33 digits of precision of __float128. I guess because it's not as well documented...
  4. Replies
    25
    Views
    34,320

    Actually, I do understand how the mantissa, sign...

    Actually, I do understand how the mantissa, sign bit, and exponent bits work in a floating point. However, I did forget the q because with normal floats (up until 64 bits), I never have to add the f...
  5. Replies
    25
    Views
    34,320

    First off, sorry for the late reply. I was (and...

    First off, sorry for the late reply. I was (and still am) on vacation.

    Anyway, Epy, the code you have suggested works up until a certain point but after that, it starts printing wrong numbers. ...
  6. Replies
    25
    Views
    34,320

    Elkvis, you're right - that line does in fact...

    Elkvis, you're right - that line does in fact prevent compilation errors but long double is still screwed up because it's still printing the wrong value.
  7. Replies
    25
    Views
    34,320

    Epy, I'm using Code::Blocks now. Initially, it...

    Epy, I'm using Code::Blocks now. Initially, it was giving the same error. Then, in its Compiler and Linker settings, I added the libquadmath.a file, within the 'lib' folder of minGW64. Now it's...
  8. Replies
    25
    Views
    34,320

    laserlight, the line added before stdio.h...

    laserlight, the line added before stdio.h inclusion was:


    #define __USE_MINGW_ANSI_STDIO

    A tab of stdio.h opens up and gives these errors:

    Line Col
    190 27 [Error] #if with no...
  9. Replies
    25
    Views
    34,320

    laserlight, my compiler has no such option,...

    laserlight, my compiler has no such option, except to the tune of "Support all ANSI standard C programs", which I have enabled just now, with no change.

    And as far as adding the line before the...
  10. Replies
    25
    Views
    34,320

    Epy, after reading some about the header...

    Epy, after reading some about the header quadmath.h (https://gcc.gnu.org/onlinedocs/lib.pdf), and confirming that my compiler had this file in its libraries, I used the following source code but it...
  11. Replies
    25
    Views
    34,320

    128 bit (long double) printf not working

    I have run the following code to see what my computer's byte size is for each data type:


    #include <stdio.h>
    #include <limits.h>

    int main()
    {
    printf("The size of char in bytes is:...
  12. Okay. It's fixed now. The changes I made to the...

    Okay. It's fixed now. The changes I made to the code were only in one place - the code below:


    // first some declarations and initializations for our main cursor pointer and the row and...
  13. Thanks, Salem. The srand(time(NULL)); line...

    Thanks, Salem. The srand(time(NULL)); line really worked, of course after I included <time.h> header.

    As for the long if statements, yes, that was stupid. I've added the rows as i and the...
  14. Why isn't my code working the way I need?

    The code below is supposed to fill a 10 x 10 character array with the element '.' and then walk through the matrix randomly using the rand() function printing the alphabet along with the movement. ...
Results 1 to 14 of 14