      SUBROUTINE MINMAX(N,DSP,ND,TYP,ZZ,YMIN,YMAX,STR,FIN,DX,YN,LU)
C
      BYTE DSP,TYP,ND
C
      XFIN=STR+FLOAT(N-1)*DX
      IF(FIN.EQ.0.0) FIN=XFIN
      IF(XFIN.LT.FIN) FIN=XFIN
      ZZ=0.0
       YMIN=9999.9
      YMAX=-9999.9
      IF(TYP.EQ.0.OR.TYP.EQ.2.OR.TYP.EQ.4.OR.TYP.EQ.6) GO TO 10
      IF(TYP.EQ.7.OR.TYP.EQ.8)GO TO 10
      YMIN=0.0
      YMAX=100.00
      ZZ=1
      GO TO 200
   10 IF(DSP.EQ.1) GO TO 101
      IF(DSP.GT.4) GO TO 500
      DO 102 I=1,N
      J=I
      READ(LU'J) B
      IF(B.GT.YMAX) YMAX=B
      IF(B.LT.YMIN) YMIN=B
  102 CONTINUE
      IF(YMIN.LT.1.0) ZZ=ABS(YMIN)+1
      IF(DSP.NE.0) GO TO 101
      GO TO 400
  101 Y=0.0
      IF(DSP.NE.1) GO TO 200
      DO 100 I=1,N
      J=I
      READ(LU'J) B
      IF(YMIN.GT.B) YMIN=B
  100 Y=Y+B
      YMAX=Y
      RETURN
  200 IF(DSP.NE.2) GO TO 300
      YMIN=ALOG10(YMIN+ZZ)
      YMAX=ALOG10(YMAX+ZZ)
      RETURN
  300 IF(DSP.NE.3) GO TO 400
      YMIN=SQRT(YMIN+ZZ)
      YMAX=SQRT(YMAX+ZZ)
      RETURN
  400 YN=100.0/YMAX
      IF(DSP.GT.4) GO TO 500
      IF(DSP.NE.4) GO TO 600
      YMIN=YN*YMIN
      YMAX=100.0
      RETURN
  500 DO 510 I=1,N
      J=I
      CALL DER(DSP,LU,ND,YX,J,N,IS)
      IF(YX.LT.YMIN) YMIN=YX
      IF(YX.GT.YMAX) YMAX=YX
  510 CONTINUE
  600 RETURN
      END
