As the following works well:
>>> a=np.float128(5)
>>> a.dtype
dtype('float128')
>>> b=a-9
>>> b.dtype
dtype('float128')
It might be simplest to write a shorthand definition that will convert this for you:
def quad(num):
return np.float128(num)
or
quad=np.float128
Just to double check:
>>> c=quad(5)-quad(4)
>>> c.dtype
dtype('float128')
>>> c
1.0
You are creating a zero-d numpy array:
>>> c.flags
C_CONTIGUOUS : True
F_CONTIGUOUS : True
OWNDATA : True
WRITEABLE : False
ALIGNED : True
UPDATEIFCOPY : False
>>> np.isscalar(c)
True
>>> c.shape
()