mirror of
https://github.com/ziglang/zig.git
synced 2026-11-22 04:37:39 -05:00
add number literal type
it gets implicitly casted to whatever is needed. closes #24
This commit is contained in:
1 parent
3d8eb10897
commit
e411467e1d
17 files changed
+892
-235
No files matched your search
+9
-1
@@ -21,8 +21,16 @@ void zig_panic(const char *format, ...) {
|
||||
}
|
||||
|
||||
uint32_t int_hash(int i) {
|
||||
return *reinterpret_cast<uint32_t*>(&i);
|
||||
return (uint32_t)(i % UINT32_MAX);
|
||||
}
|
||||
bool int_eq(int a, int b) {
|
||||
return a == b;
|
||||
}
|
||||
|
||||
uint32_t uint64_hash(uint64_t i) {
|
||||
return (uint32_t)(i % UINT32_MAX);
|
||||
}
|
||||
|
||||
bool uint64_eq(uint64_t a, uint64_t b) {
|
||||
return a == b;
|
||||
}
|
||||
Reference in new issue
Block a user