From: Hans K. <Han...@kv...> - 2005-04-11 07:52:35
|
Ok, output for i=2^30 and j=2*i Result: i= 1073741824 j= -2147483648 integer type seem equal to integer*4 /Hans On Mon, 2005-04-11 at 09:26 +0200, Arjen Markus wrote: > Hans Karlsson wrote: > > > > 1) I changed > > typedef long PLINT; ==> typedef int PLINT > > in include/plplot.h and now the f77 example code works fine. > > > > 2) I run your test below with the result that > > (j.gt.i) i.e. 'integer type is large enough' > > > > Regards, > > Hans > > > > > > Hans, can you confirm whether there is a difference between integer > > > and integer*4 on your platform? Probably easiest to see with: > > > > > > integer i,j > > > i = 2*31 > > > j = 2*i > > > if ( j .gt. i ) then > > > write(*,*) 'Integer type is large enough' > > > else > > > write(*,*) 'Integer type seems equal to integer*4' > > > endif > > > > > > or some such program. > > > > > Aaargh, I should have tested it first :( > > Change the line "i = 2*31" into: "i = 2**30" > > (The ** is crucial) > > Regards, > > Arjen > -- |