smallest number allowed by my system

Hey,

I have a couple of questions

1)Is there any special variable assigned for the smallest and largest possible numbers allowed by my system ? like int.MinValue, int.MaxValue or something of that sort ?

2)Does it depend on my system alone or does it also depend on my version of gcc ?

Thanks

PS : I have a 64 bit system, running gcc (GCC) 4.1.2 20080704 (Red Hat 4.1.2-52)

What's the smallest and largest numbers that I can get ?

Re: smallest number allowed by my system

Hey I did this :)

Code:

`#include <stdio.h>`

#include <math.h>

int main(void)

{

//printf("\nLargest possible number = %u",(unsigned int)((pow(2,(double)((sizeof(unsigned int)) * 8)))));

printf("\nLargest possible number = %d",(int)((pow(2,(double)((sizeof(unsigned int)) * 8)))));

return 0;

}

Re: smallest number allowed by my system

Define smallest for us? On the number line, a negative number would be the smallest, but you could be talking about number of decimal points of accuracy.

In 32 bits:

Largest unsigned int is (2^32)-1==4294967295

Smallest unsigned int is 0

Largest signed int is (2^31)-1==2147483647

Smallest signed int is -1*(2^31)=-2147483648

64 bits, just change the math to 64/63 from 32 and 31 respectively.

Thanks,

Cipherboy

Re: smallest number allowed by my system

Quote:

Originally Posted by

**cipherboy_loc**
Define smallest for us? On the number line, a negative number would be the smallest, but you could be talking about number of decimal points of accuracy.

In 32 bits:

Largest unsigned int is (2^32)-1==4294967295

Smallest unsigned int is 0

Largest signed int is (2^31)-1==2147483647

Smallest signed int is -1*(2^31)=-2147483648

64 bits, just change the math to 64/63 from 32 and 31 respectively.

Thanks,

Cipherboy

Thanks Cipherboy :)

Re: smallest number allowed by my system