Exemplo n.º 1
0
def make_float_packer(size):
    return lambda fmtiter: ieee.pack_float(fmtiter.result,
                                           fmtiter.accept_float_arg(),
                                           size,
                                           fmtiter.bigendian)
Exemplo n.º 2
0
def test_pack():
    for number, size, bigendian, expected in testcases:
        print "test_pack:", number, size, bigendian
        res = []
        pack_float(res, number, size, bigendian)
        assert "".join(res) == expected
Exemplo n.º 3
0
def pack_float(f):
    result = []
    ieee.pack_float(result, f, 8, False)
    return ''.join(result)
Exemplo n.º 4
0
def pack_float(f):
    result = []
    ieee.pack_float(result, f, 8, False)
    return ''.join(result)
Exemplo n.º 5
0
def test_pack():
    for number, size, bigendian, expected in testcases:
        print 'test_pack:', number, size, bigendian
        res = []
        pack_float(res, number, size, bigendian)
        assert ''.join(res) == expected
Exemplo n.º 6
0
def make_float_packer(size):
    return lambda fmtiter: ieee.pack_float(
        fmtiter.result, fmtiter.accept_float_arg(), size, fmtiter.bigendian)