1996-12-23 23:39:42 +00:00
|
|
|
from test_support import verbose
|
1996-12-17 00:00:53 +00:00
|
|
|
import _xdr
|
|
|
|
|
|
|
|
fd = 8.01
|
1996-12-23 23:39:42 +00:00
|
|
|
print '_xdr.pack_float()'
|
1996-12-17 00:00:53 +00:00
|
|
|
s = _xdr.pack_float(fd)
|
1996-12-23 23:39:42 +00:00
|
|
|
if verbose:
|
|
|
|
print `s`
|
|
|
|
print '_xdr.unpack_float()'
|
1996-12-17 00:00:53 +00:00
|
|
|
f = _xdr.unpack_float(s)
|
|
|
|
if verbose:
|
|
|
|
print f
|
|
|
|
if int(100*f) <> int(100*fd):
|
|
|
|
print 'pack_float() <> unpack_float()'
|
|
|
|
|
|
|
|
fd = 9900000.9
|
1996-12-23 23:39:42 +00:00
|
|
|
print '_xdr.pack_double()'
|
1996-12-17 00:00:53 +00:00
|
|
|
s = _xdr.pack_double(fd)
|
1996-12-23 23:39:42 +00:00
|
|
|
if verbose:
|
|
|
|
print `s`
|
|
|
|
print '_xdr.unpack_double()'
|
1996-12-17 00:00:53 +00:00
|
|
|
f = _xdr.unpack_double(s)
|
|
|
|
if verbose:
|
|
|
|
print f
|
|
|
|
|
|
|
|
if int(100*f) <> int(100*fd):
|
|
|
|
print 'pack_double() <> unpack_double()'
|