Determine if an ndarray data type can be cast to another ndarray data type according to a specified casting mode.