One more way to transform a float to single (commented out)

This commit is contained in:
Sei Lisa 2016-05-21 01:59:05 +02:00
parent 94ea0a1140
commit 4172f02439

View file

@ -134,6 +134,10 @@ def F32(f, f32=True):
#from struct import pack, unpack
#return unpack('f', pack('f', f))[0]
# Using numpy:
#import numpy
#return float(numpy.float32(f))
# Using ctypes:
#from ctypes import c_float
return c_float(f).value