import numpy as np u = np.array([1, 2, -1], dtype=object) v = np.array([-1, 1, 0], dtype=object) np.cross(u, v) fails with numpy._core._exceptions._UFuncOutputCastingError: Cannot cast ufunc 'multiply' output from dtype('O') to dtype('int64') with casting rule 'same_kind'. np.dot(u, v) works as expected. Using dtype=object because calculations with actual data will overflow int64 and give incorrect results (without warning). The actual values are integers with about 15 significant digits (50 binary digits). One workaround is to make all values Decimals: u = np.array(list(map(Decimal, [1, 2, -1]))) v = np.array(list(map(Decimal, [-1, 1, 0]))) np.cross(u, v) Is there a better workaround using numpy? Continue reading...