MCPcopy Create free account
hub / github.com/aguinet/dragonffi / upck_double

Method upck_double

bindings/python/tests/test_mdarray.py:33–36  ·  view source on GitHub ↗
(v)

Source from the content-addressed store, hash-verified

31 ArV = memoryview(Ar)
32 self.assertEqual(ArV.format, "d")
33 def upck_double(v):
34 if isinstance(v,float):
35 return v
36 return struct.unpack("d",v)[0]
37 self.assertTrue(all(upck_double(a) == b for a,b in zip(ArV,Ref)))
38
39 Ar2Ty = FFI.arrayType(FFI.arrayType(FFI.DoubleTy, 10), 2)

Callers

nothing calls this directly

Calls 1

isinstanceFunction · 0.85

Tested by

no test coverage detected