File tree Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Expand file tree Collapse file tree 1 file changed +2
-6
lines changed Original file line number Diff line number Diff line change @@ -295,9 +295,7 @@ def sympy2symengine(a, raise_error=False):
295
295
return RealDouble(float (str (a)))
296
296
ELSE :
297
297
return RealDouble(float (str (a)))
298
- elif isinstance (a, np.float16):
299
- return RealDouble(a)
300
- elif isinstance (a, np.float32):
298
+ elif have_numpy and isinstance (a, (np.float16, np.float32)):
301
299
return RealDouble(a)
302
300
elif a is sympy.I:
303
301
return I
@@ -562,9 +560,7 @@ def _sympify(a, raise_error=True):
562
560
return Integer(a)
563
561
elif isinstance (a, float ):
564
562
return RealDouble(a)
565
- elif isinstance (a, np.float16):
566
- return RealDouble(a)
567
- elif isinstance (a, np.float32):
563
+ elif have_numpy and isinstance (a, (np.float16, np.float32)):
568
564
return RealDouble(a)
569
565
elif isinstance (a, complex ):
570
566
return ComplexDouble(a)
You can’t perform that action at this time.
0 commit comments