mirror of
https://github.com/ziglang/zig.git
synced 2024-11-30 09:02:32 +00:00
12 lines
236 B
Zig
12 lines
236 B
Zig
fn max(comptime T: type, a: T, b: T) T {
|
|
return if (a > b) a else b;
|
|
}
|
|
fn gimmeTheBiggerFloat(a: f32, b: f32) f32 {
|
|
return max(f32, a, b);
|
|
}
|
|
fn gimmeTheBiggerInteger(a: u64, b: u64) u64 {
|
|
return max(u64, a, b);
|
|
}
|
|
|
|
// syntax
|