I sometimes perform an operation of two arguments that I know will always return a real-valued object, even if the input arrays are complex-valued. (Think inner products <z, z>.) I usually
confirm its realness up to a tolerance and clip off the imaginary part. For return values of real data type, this is not necessary, so I shortcut with
I sometimes perform an operation of two arguments that I know will always return a real-valued object, even if the input arrays are complex-valued. (Think inner products
<z, z>
.) I usually confirm its realness up to a tolerance and clip off the imaginary part. For return values of real data type, this is not necessary, so I shortcut within NumPy.
Is something similar available in the Array API yet?