Add intrinsics.constant_(floor|truncate|ceil|round)

This commit is contained in:
gingerBill
2025-10-30 08:52:21 +00:00
parent 13ddf66cc9
commit 99520d82fd
4 changed files with 60 additions and 1 deletions

View File

@@ -1296,6 +1296,15 @@ gb_internal bool is_type_rune(Type *t) {
}
return false;
}
gb_internal bool is_type_integer_or_float(Type *t) {
t = base_type(t);
if (t == nullptr) { return false; }
if (t->kind == Type_Basic) {
return (t->Basic.flags & (BasicFlag_Integer|BasicFlag_Float)) != 0;
}
return false;
}
gb_internal bool is_type_numeric(Type *t) {
t = base_type(t);
if (t == nullptr) { return false; }