      subroutine mslash (x,xyz,ierr)                                    MSLA001
c ----------------------------------------                              MSLA002
c     transform rationals to fractionals                                MSLA003
c ----------------------------------------                              MSLA004
      character id*3,xyz*8, minus                                       MSLA005
      real b(8),x                                                       MSLA006
      dimension id(8)                                                   MSLA007
                                                                        MSLA008
      data (b(i),i=1,8)/0.0,0.50000,0.33333,0.25000,0.12500,0.75000,    MSLA009
     & 0.66667,0.37500/                                                 MSLA010
      data (id(i),i=1,8)/'0','1/2','1/3','1/4','1/8','3/4','2/3','3/8'/ MSLA011
                                                                        MSLA012
      ierr=0                                                            MSLA013
                                                                        MSLA014
c --- if mod operation is one within 4 digits, its a fractional --      MSLA015
      do 0001 i=1,8                                                     MSLA016
         diff=abs(x)-b(i)                                               MSLA017
         if (abs(diff).lt.0.0001) goto 0002                             MSLA018
 0001 continue                                                          MSLA019
      write (xyz,'(f8.5)') x                                            MSLA020
c     write (*,*) xyz                                                   MSLA021
      return                                                            MSLA022
                                                                        MSLA023
 0002 minus=' '                                                         MSLA024
      if (x.lt.-0.00001) minus='-'                                      MSLA025
      write (xyz,'(a1,a3)') minus, id(i)                                MSLA026
c     write (*,*) xyz                                                   MSLA027
      return                                                            MSLA028
      end                                                               MSLA029
                                                                        MSLA030
