From 38bf79e741cb3ff9a07f96fa3f09fb5cd6f34f3f Mon Sep 17 00:00:00 2001 From: AdrienBouvais Date: Tue, 21 Apr 2026 11:26:39 +0200 Subject: [PATCH] Removed old function usless after optimization --- src/main.zig | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/main.zig b/src/main.zig index bd328b2..3e616c9 100644 --- a/src/main.zig +++ b/src/main.zig @@ -17,34 +17,6 @@ pub fn Quantity(T: type, d: Dimensions, s: Scales) type { pub const dims: Dimensions = d; pub const scales = s; - /// Internal helper to convert any supported T to f64 for math - fn toF64(val: anytype) f64 { - const TIn = @TypeOf(val); - return switch (@typeInfo(TIn)) { - .int => @floatFromInt(val), - .float => @floatCast(val), - else => @compileError("Unsupported type for Quantity"), - }; - } - - /// Internal helper to convert f64 back to the target T - fn fromF64(val: f64) T { - return switch (@typeInfo(T)) { - .int => @intFromFloat(@round(val)), - .float => @floatCast(val), - else => unreachable, - }; - } - - /// Helper for integer power of 10 at comptime - fn pow10(comptime exp: i32) T { - var res: T = 1; - var i: i32 = 0; - const abs_exp = if (exp < 0) -exp else exp; - while (i < abs_exp) : (i += 1) res *= 10; - return res; - } - pub fn add(self: Self, rhs: anytype) Quantity( T, dims,