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...
Type: Posts; User: AamirYousafi
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...
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...
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...
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...
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. ...
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.
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...
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...
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...
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...
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:...
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...
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...
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. ...