arg_in_segment Function

private pure elemental function arg_in_segment(a, seg) result(res)

Checks if the given integer is within the specified segment.

This function determines whether the integer a falls within the range defined by the min and max values of the segment_t type.

Arguments

Type IntentOptional Attributes Name
integer(kind=int32), intent(in) :: a
type(segment_t), intent(in) :: seg

Return Value logical


Source Code

   pure elemental function arg_in_segment(a, seg) result(res)
      implicit none
      integer(int32),  intent(in) :: a
      type(segment_t), intent(in) :: seg
      logical :: res

      res = seg%min <= a .and. a <= seg%max
   end function arg_in_segment