diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-08-31 23:05:16 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2026-08-31 23:05:16 +0200 |
| commit | 804204db7cf1e8a28defd359d17fa72949e13eff (patch) | |
| tree | 3536d961838d1a6640d1295d808768736bf2317b /src/Float.zig | |
| parent | 956cd84ca545f1d93e2218cbbdbb39c81a46bec8 (diff) | |
Implement with ptrCast to make it more transparent.
Diffstat (limited to 'src/Float.zig')
| -rw-r--r-- | src/Float.zig | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/Float.zig b/src/Float.zig deleted file mode 100644 index 5877d12..0000000 --- a/src/Float.zig +++ /dev/null @@ -1,22 +0,0 @@ -const c = @import("c"); - -const zpy = @import("root.zig"); -const conversion = zpy.conversion; - -const Self = @This(); - -object: zpy.Object, - -pub fn from(value: f64) !Self { - return .{ - .object = .fromPtr(try conversion.ptr(c.PyFloat_FromDouble(value))), - }; -} - -pub fn asDouble(self: *const Self) f64 { - return c.PyFloat_asDouble(self.object.ptr); -} - -pub fn deinit(self: *Self) void { - self.object.decref(); -} |