mirror of
https://github.com/ml-explore/mlx.git
synced 2025-12-16 01:49:05 +08:00
iinfo and scalar overflow detection (#2009)
This commit is contained in:
@@ -67,6 +67,14 @@ struct finfo {
|
||||
double max;
|
||||
};
|
||||
|
||||
/** Holds information about integral types. */
|
||||
struct iinfo {
|
||||
explicit iinfo(Dtype dtype);
|
||||
Dtype dtype;
|
||||
int64_t min;
|
||||
uint64_t max;
|
||||
};
|
||||
|
||||
/** The type from promoting the arrays' types with one another. */
|
||||
inline Dtype result_type(const array& a, const array& b) {
|
||||
return promote_types(a.dtype(), b.dtype());
|
||||
|
||||
Reference in New Issue
Block a user