authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-02-14 20:23:54 -08:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2023-02-14 20:23:54 -08:00
logd724aefba7f83ffdfb4065eec36bd57794031927
tree14e1551898a5545e6e2195708b3c7ed941b7aeb2
parent5f7abef04e03f14aa6741d31a10cfa024c4424d0

remove intToFloat()


1 files changed, 1 insertions(+), 5 deletions(-)

src/lib.zig+1-5
...@@ -19,11 +19,7 @@ pub fn reduceNumber(alloc: std.mem.Allocator, input: u64, comptime unit: u64, co...@@ -19,11 +19,7 @@ pub fn reduceNumber(alloc: std.mem.Allocator, input: u64, comptime unit: u64, co
19 div *= unit;19 div *= unit;
20 exp += 1;20 exp += 1;
21 }21 }
22 return try std.fmt.allocPrint(alloc, "{d:.3} {s}{s}", .{ intToFloat(input) / intToFloat(div), prefixes[exp .. exp + 1], base });22 return try std.fmt.allocPrint(alloc, "{d:.3} {s}{s}", .{ @intToFloat(f64, input) / @intToFloat(f64, div), prefixes[exp .. exp + 1], base });
23}
24
25pub fn intToFloat(n: u64) f64 {
26 return @intToFloat(f64, n);
27}23}
2824
29pub fn addSentinel(alloc: std.mem.Allocator, comptime T: type, input: []const T, comptime sentinel: T) ![:sentinel]const T {25pub fn addSentinel(alloc: std.mem.Allocator, comptime T: type, input: []const T, comptime sentinel: T) ![:sentinel]const T {