replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - 8 byte integer
forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

8 byte integer

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General
View previous topic :: View next topic  
Author Message
christyleomin



Joined: 08 Apr 2011
Posts: 155

PostPosted: Wed Aug 15, 2012 2:37 pm    Post subject: 8 byte integer Reply with quote

I have declared as below:

Code:
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?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 8211
Location: Salford, UK

PostPosted: Wed Aug 15, 2012 3:36 pm    Post subject: Reply with quote

c should be OK as INTEGER*4 but you can always run a test to make sure.
Back to top
View user's profile Send private message AIM Address
JohnCampbell



Joined: 16 Feb 2006
Posts: 2615
Location: Sydney

PostPosted: Thu Aug 16, 2012 2:31 am    Post subject: Reply with quote

range is from 0 to 2^31 (2,147,483,648), due to sign bit.
Back to top
View user's profile Send private message
davidb



Joined: 17 Jul 2009
Posts: 560
Location: UK

PostPosted: Thu Aug 16, 2012 6:45 am    Post subject: Reply with quote

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.
_________________
Programmer in: Fortran 77/95/2003/2008, C, C++ (& OpenMP), java, Python, Perl
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> General All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group