Silverfrost Forums

Welcome to our forums

Division problem

6 Oct 2008 7:18 #3876

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

6 Oct 2008 7:35 #3877

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

You need something like REAL(j)/1000.0.

6 Oct 2008 8:15 #3878

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

best regards

Please login to reply.