summaryrefslogtreecommitdiff
path: root/src/libzisp/value/fixnum.zig
diff options
context:
space:
mode:
Diffstat (limited to 'src/libzisp/value/fixnum.zig')
-rw-r--r--src/libzisp/value/fixnum.zig12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/libzisp/value/fixnum.zig b/src/libzisp/value/fixnum.zig
index c705880..80fb4ae 100644
--- a/src/libzisp/value/fixnum.zig
+++ b/src/libzisp/value/fixnum.zig
@@ -19,19 +19,15 @@ pub fn assert(v: Value) void {
}
// See detailed NaN packing docs for why the +/- 1.
-const fixnum_min = std.math.minInt(i52) + 1;
-const fixnum_max = std.math.maxInt(i52) - 1;
-
-pub fn isValidRange(int: i64) bool {
- return fixnum_min < int and int < fixnum_max;
-}
+pub const min = std.math.minInt(i52) + 1;
+pub const max = std.math.maxInt(i52) - 1;
fn assertValidRange(int: i64) void {
- if (int < fixnum_min) {
+ if (int < min) {
std.debug.print("int too small for fixnum: {}\n", .{int});
@panic("int too small for fixnum");
}
- if (int > fixnum_max) {
+ if (int > max) {
std.debug.print("int too large for fixnum: {}\n", .{int});
@panic("int too large for fixnum");
}