C+
C NAME:
C	cvntvms
C-
        program cvntvms
	include		'dirspec.h'
	include		'openfile.h'
	include		'math.h'

	character	cOp*3
	logical		bWrite

	real*4		xx
	real*8		dd
	integer		i4(2)
	equivalence	(dd,i4),(xx,i4)

	real*4		xdos
	real*8		ddos
	integer		idos(2)
	equivalence	(ddos,idos),(xdos,idos)

	real*4		xvms
	real*8		dvms
	integer		ivms(2)
	equivalence	(dvms,ivms),(xvms,ivms)

	dd = MATH__NARN8

	cOp = OS__VMS
	if (cOpSys .eq. OS__VMS) cOp = OS__DOS

	xx = .29E-36

	I0 = I
	do while (I-I0 .lt. 60)
	    I = I+1

	    ii = 0
	    if (cOpSys .eq. OS__DOS) call MVBITS(i4(1),23,8,ii,0)
	    if (cOpSys .eq. OS__VMS) call MVBITS(i4(1), 7,8,ii,0)

	    xvms = xx
	    call CvR4S(cOpSys,cOp,1,xvms)

	    xdos = xvms
	    call CvR4S(cOp,cOpSys,1,xdos)

	    print *, ' exp ',ii, xx, xdos, xdos-xx, idos(1)-i4(1)

	    xx = xx/1.1
	end do

	xx = MATH__PINF/100.
	I0 = I

	do while (I-I0 .lt. 10)
	    I = I+1

	    ii = 0
	    if (cOpSys .eq. OS__DOS) call MVBITS(i4(1),23,8,ii,0)
	    if (cOpSys .eq. OS__VMS) call MVBITS(i4(1), 7,8,ii,0)

	    xvms = xx
	    call CvR4S(cOpSys,cOp,1,xvms)

	    xdos = xvms
	    call CvR4S(cOp,cOpSys,1,xdos)

	    print *, ' exp ',ii, xx, xdos, xdos-xx, idos(1)-i4(1)

	    if (cOpSys .ne. OS__VMS .or. xx .lt. MATH__PINF/2.) xx = xx*2
	end do

	dd = 0.56D-306
	I0 = I
	do while (I-I0 .lt. 60)
	    I = I+1

	    ii = 0
	    if (cOpSys .eq. OS__DOS) call MVBITS(i4(2),20,11,ii,0)
	    if (cOpSys .eq. OS__VMS) call MVBITS(i4(1), 4,11,ii,0)

	    dvms = dd
	    call CvR8S(cOpSys,cOp,1,dvms)

	    ddos = dvms
	    call CvR8S(cOp,cOpSys,1,ddos)

	    print *, ' exp ',ii, dd, ddos, ddos-dd, idos(1)-i4(1), idos(2)-i4(2)

	    dd = dd/1.1d0
	end do

	dd = MATH__PINF8/100.
	I0 = I

	do while (I-I0 .lt. 10)
	    I = I+1

	    ii = 0
	    if (cOpSys .eq. OS__DOS) call MVBITS(i4(2),20,11,ii,0)
	    if (cOpSys .eq. OS__VMS) call MVBITS(i4(1), 4,11,ii,0)

	    dvms = dd
	    call CvR8S(cOpSys,cOp,1,dvms)

	    ddos = dvms
	    call CvR8S(cOp,cOpSys,1,ddos)

	    print *, ' exp ',ii, dd, ddos, ddos-dd, idos(1)-i4(1), idos(2)-i4(2)

	    if (cOpSys .ne. OS__VMS .or. dd .lt. MATH__PINF8/2) dd = dd*2d0
	end do

 	end
