divides Function

public pure function divides(factor, dividend)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: factor
integer, intent(in) :: dividend

Return Value logical


Called by

proc~~divides~~CalledByGraph proc~divides divides interface~operator(.divides.) operator(.divides.) interface~operator(.divides.)->proc~divides proc~test_divides test_divides proc~test_divides->proc~divides

Source Code

   pure logical function divides(factor, dividend)
      integer, intent(in) :: factor
      integer, intent(in) :: dividend
      ! mod returns the remainder of dividend/factor, and if it is 0, factor divides dividend evenly
      if(factor /= 0) then ! To avoid divide by 0
          divides = mod(dividend, factor)==0
      else
          divides = .FALSE.
      endif
   end function divides