0

How can I cast np.longdouble to mpmath.mpf?

import numpy as np
import mpmath

b = np.longdouble(1.0)
a = mpmath.mpf(b)
print (a)
Jakub
  • 1
  • 1

1 Answers1

0

You will have to convert the longdouble to np.float64 :

import numpy as np
import mpmath

b = np.longdouble(1.0)
c= np.float64(b)
a = mpmath.mpf(c)
print (a)
Roshin Raphel
  • 2,612
  • 4
  • 22
  • 40