!-------------------------------------------------
!  GNMlib Module
!-------------------------------------------------
module gnmlib
  use dcl_common
  contains
!-----------------------------------------------------------------
    subroutine DclGoodNumExLT(value,mantissa,exponent)  
      real,      intent(in)  :: value                   !調べる実数値
      real,      intent(out) :: mantissa                !きりのよい数の仮数部
      integer,   intent(out) :: exponent                !きりのよい数の指数部
      call gnlt(value,mantissa,exponent)
    end subroutine
      
    subroutine DclGoodNumExGT(value,mantissa,exponent) 
      real,      intent(in)  :: value                   !調べる実数値
      real,      intent(out) :: mantissa                !きりのよい数の仮数部
      integer,   intent(out) :: exponent                !きりのよい数の指数部
      call gngt(value,mantissa,exponent)
    end subroutine
      
    subroutine DclGoodNumExLE(value,mantissa,exponent) 
      real,      intent(in)  :: value                   !調べる実数値
      real,      intent(out) :: mantissa                !きりのよい数の仮数部
      integer,   intent(out) :: exponent                !きりのよい数の指数部
      call gnle(value,mantissa,exponent)
    end subroutine
      
    subroutine DclGoodNumExGE(value,mantissa,exponent) 
      real,      intent(in)  :: value                   !調べる実数値
      real,      intent(out) :: mantissa                !きりのよい数の仮数部
      integer,   intent(out) :: exponent                !きりのよい数の指数部
      call gnge(value,mantissa,exponent)
    end subroutine
      
    subroutine DclSetGoodNumList(list)
      real, intent(in), dimension(:) :: list !きりのよい数を昇順に納めた実数型配列．
      call gnsblk(list, size(list))
    end subroutine
      
    subroutine DclGetGoodNumList(list)
      real, intent(out), dimension(:) :: list !きりのよい数を昇順に納めた実数型配列
      call gnqblk(list, size(list))
    end subroutine
      
    subroutine DclSaveGoodNumList()
      call gnsave()
    end subroutine
      
    subroutine DclRestoreGoodNumList() 
      call gnrset()
    end subroutine
!-----------------------------------------------------------------      
    function DclGoodNumLT(value)
      real, intent(in) :: value 
      real             :: DclGoodNumLT
      DclGoodNumLT = rgnlt(value)
    end function
      
    function DclGoodNumLE(value) 
      real, intent(in) :: value  
      real             :: DclGoodNumLE
      DclGoodNumLE = rgnle(value) 
    end function
      
    function DclGoodNumGT(value) 
      real, intent(in) :: value
      real             :: DclGoodNumGT
      DclGoodNumGT = rgngt(value) 
    end function
      
    function DclGoodNumGE(value)
      real, intent(in) :: value 
      real             :: DclGoodNumGE
      DclGoodNumGE = rgnge(value)
    end function

end module
