replica nfl jerseysreplica nfl jerseyssoccer jerseyreplica nfl jerseys forums.silverfrost.com :: View topic - Division problem
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 

Division problem

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



Joined: 22 May 2008
Posts: 20

PostPosted: Mon Oct 06, 2008 8:18 pm    Post subject: Division problem Reply with quote

Hi ,

I�m running the program attached and I find a wierd problem that I�m not able to find solution:


INTEGER :: i,j, ierror
INTEGER, PARAMETER :: n=2560
REAL :: a

sigma(1)=0.00
b(1)= 0.00
do i=2,2559
PRINT *, i,Pbacksignal(i),z(i)
do j=1,1000
a=j/1000
print *, j,a
end do

It�s simple, but the a operation is not being done, I always get 0.000, it�s not doing the division!,
Please any clue for this is more than welcomed
Thanks in advance

Best regards
Rafael Castillo
Back to top
View user's profile Send private message Send e-mail
PaulLaidler
Site Admin


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

PostPosted: Mon Oct 06, 2008 8:35 pm    Post subject: Reply with quote

j/1000 is integer division giving the whole number part of the arithmetic result.

You need something like REAL(j)/1000.0.
Back to top
View user's profile Send private message AIM Address
kingkastle



Joined: 22 May 2008
Posts: 20

PostPosted: Mon Oct 06, 2008 9:15 pm    Post subject: Reply with quote

Thanks very much!!!!
already working!!!

best regards
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support 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