diff options
| author | gingerBill <gingerBill@users.noreply.github.com> | 2025-10-30 08:52:21 +0000 |
|---|---|---|
| committer | gingerBill <gingerBill@users.noreply.github.com> | 2025-10-30 08:52:21 +0000 |
| commit | 99520d82fd26316fc795ae524cc0dfa3477fdac8 (patch) | |
| tree | 3b99392059a143a35970ac4dedf64cf7acb7f3cb /src/types.cpp | |
| parent | 13ddf66cc96a50e96ce9c31875375926482b9cee (diff) | |
Add `intrinsics.constant_(floor|truncate|ceil|round)`
Diffstat (limited to 'src/types.cpp')
| -rw-r--r-- | src/types.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/types.cpp b/src/types.cpp index bf668e5f6..a1311ba5d 100644 --- a/src/types.cpp +++ b/src/types.cpp @@ -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; } |