iinfo and scalar overflow detection (#2009)

This commit is contained in:
Awni Hannun
2025-03-27 19:54:56 -07:00
committed by GitHub
parent bc62932984
commit 5580b47291
6 changed files with 112 additions and 0 deletions

View File

@@ -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());