diff options
Diffstat (limited to 'src/exact_value.cpp')
| -rw-r--r-- | src/exact_value.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/exact_value.cpp b/src/exact_value.cpp index 30d4fd649..fb392c831 100644 --- a/src/exact_value.cpp +++ b/src/exact_value.cpp @@ -141,6 +141,8 @@ ExactValue exact_value_integer_from_string(String const &string) { return result; } + + f64 float_from_string(String string) { isize i = 0; u8 *str = string.text; @@ -296,6 +298,16 @@ ExactValue exact_value_to_integer(ExactValue v) { return r; } +i64 exact_value_to_i64(ExactValue v) { + v = exact_value_to_integer(v); + i64 result = 0; + if (v.kind == ExactValue_Integer) { + return big_int_to_i64(&v.value_integer); + } + return result; +} + + ExactValue exact_value_to_float(ExactValue v) { switch (v.kind) { case ExactValue_Integer: |