I need to do something along the lines of
if (self.count + 1 > self.entries.len * max_load) {
,,,
where max_load is an f64 set to 0.75 and both .len and .count are usize
obviously zig requires you to convert them to proper values, but in the above example i will have to
- convert
self.entries.lento float - multiply it by
max_load - convert it back to
usize - THEN do the comparison
with all of the above it now looks like
if (self.count + 1 > @as(usize, @intFromFloat(@as(f64, @floatFromInt(self.entries.len)) * max_load))) {
...
this works but is insanely ugly, is there a better way to do it?