mirror of
https://github.com/Ed94/Odin.git
synced 2026-07-11 05:41:25 -07:00
Hexadecimal floats for "perfect values" 0h42f60000 == 123; use bit_cast in compiler
This commit is contained in:
@@ -12,6 +12,14 @@
|
||||
|
||||
#include <math.h>
|
||||
|
||||
|
||||
template <typename U, typename V>
|
||||
gb_inline U bit_cast(V &v) { return reinterpret_cast<U &>(v); }
|
||||
|
||||
template <typename U, typename V>
|
||||
gb_inline U const &bit_cast(V const &v) { return reinterpret_cast<U const &>(v); }
|
||||
|
||||
|
||||
gb_inline i64 align_formula(i64 size, i64 align) {
|
||||
if (align > 0) {
|
||||
i64 result = size + align-1;
|
||||
@@ -164,6 +172,7 @@ u64 u64_from_string(String string) {
|
||||
case 'd': base = 10; has_prefix = true; break;
|
||||
case 'z': base = 12; has_prefix = true; break;
|
||||
case 'x': base = 16; has_prefix = true; break;
|
||||
case 'h': base = 16; has_prefix = true; break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user