diff options
| author | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2025-10-30 11:29:59 +0100 |
|---|---|---|
| committer | Jeroen van Rijn <Kelimion@users.noreply.github.com> | 2025-10-30 11:29:59 +0100 |
| commit | 1a00d02ee73b826d5cfa4eba06625ceee921c180 (patch) | |
| tree | b078e3df222f4c24f48a1ab55bb257e86c6b7349 /src/types.cpp | |
| parent | 5b6889ccf5acc39a945d044ada96c88f714a9c23 (diff) | |
| parent | 074a8d7df5e024117d7f91944ccf053cad27ca0e (diff) | |
Merge branch 'master' of github.com:odin-lang/Odin
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; } |