Hi,
I did a little bit more of search and figured that if i use the long
long for my X, Y coordinates and the sums, I should be able to handle
extremely large numbers. But now When i do that, it still give me
incorrect results. Even when i try to assign them those high values
directly, it fails!!!!
Here is my code.
table.sumX = 12338578;
table.sumY = -3336078;
table.sumXSquared = 7260107358192; <-- 252
table.sumXY = -1646741910392; <--- 253
This is the compile warning!
Cricket.c:252: warning: integer constant is too large for "long" type
Cricket.c:253: warning: integer constant is too large for "long" type
Cricket.c:259: warning: long int format, different type arg (arg 3)
<-- Why these warnings?
Cricket.c:259: warning: long int format, different type arg (arg 4)
<--It prints something wrong as well :(
where i have defined table as of type regTable (i know long long and
int64_t are the same but i am clutching at straws)
typedef struct regressTbl{
int16_t n ;
long long sumXY;
int64_t sumX,sumY;
long long sumXSquared;
}regTable;
Any ideas?