Silverfrost Forums

Welcome to our forums

8 byte integer

15 Aug 2012 1:37 #10616

I have declared as below:

integer*8 a,b

integer c

a = b+c

I have declared a and b as 8 bytes because at times their amx value evaluates greater than **4,294,967,296 ** (because a 4 byte integer can have 8 * 4 = 32 bits, so your range is from 0 to 2^32 (4,294,967,296)

Is it also necessary to declate c as 8 byte inteegr in such a case?

15 Aug 2012 2:36 #10617

c should be OK as INTEGER*4 but you can always run a test to make sure.

16 Aug 2012 1:31 #10620

range is from 0 to 2^31 (2,147,483,648), due to sign bit.

16 Aug 2012 5:45 #10621

The maximum 32 bit integer is 0 to 2**31-1 (2,147,483,647).

The minimum 32 bit integer is -2,147,483,647 since, strictly speaking, Fortran uses a symmetric integer model, though most compilers use twos complement maths and let you go down to -2,147,483,648.

Please login to reply.