diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2019-12-10 11:13:39 -0500 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2019-12-10 11:13:39 -0500 |
| commit | 9561e7c6b9fb2d9ebcbfd611196db698372ae7bd (patch) | |
| tree | 6b4fd0751e80a9c4128756d59d3c0bfecd230498 /lib/std/math/ln.zig | |
| parent | cd4d638d10365e47bcb371119dcee22581355ac4 (diff) | |
| parent | 30715560c829d5636734edf7eabff3ee4d170e5d (diff) | |
| download | zig-9561e7c6b9fb2d9ebcbfd611196db698372ae7bd.tar.gz zig-9561e7c6b9fb2d9ebcbfd611196db698372ae7bd.zip | |
Merge branch 'Snektron-typeOf-to-TypeOf'
closes #3875
closes #1348
Diffstat (limited to 'lib/std/math/ln.zig')
| -rw-r--r-- | lib/std/math/ln.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/std/math/ln.zig b/lib/std/math/ln.zig index fd5741a818..f9bf03f83d 100644 --- a/lib/std/math/ln.zig +++ b/lib/std/math/ln.zig @@ -17,11 +17,11 @@ const TypeId = builtin.TypeId; /// - ln(0) = -inf /// - ln(x) = nan if x < 0 /// - ln(nan) = nan -pub fn ln(x: var) @typeOf(x) { - const T = @typeOf(x); +pub fn ln(x: var) @TypeOf(x) { + const T = @TypeOf(x); switch (@typeId(T)) { TypeId.ComptimeFloat => { - return @typeOf(1.0)(ln_64(x)); + return @TypeOf(1.0)(ln_64(x)); }, TypeId.Float => { return switch (T) { @@ -31,7 +31,7 @@ pub fn ln(x: var) @typeOf(x) { }; }, TypeId.ComptimeInt => { - return @typeOf(1)(math.floor(ln_64(@as(f64, x)))); + return @TypeOf(1)(math.floor(ln_64(@as(f64, x)))); }, TypeId.Int => { return @as(T, math.floor(ln_64(@as(f64, x)))); |
