diff options
| author | Andrew Kelley <superjoe30@gmail.com> | 2017-08-09 10:09:38 -0400 |
|---|---|---|
| committer | Andrew Kelley <superjoe30@gmail.com> | 2017-08-09 10:09:38 -0400 |
| commit | 35d3444e2742faa3c2e805cdcbfeceaf0287eefc (patch) | |
| tree | 408182308c5f962660f200c59b2619be8d194ffc /std/math/log10.zig | |
| parent | 54675b060ae6139f60e111521b9a2688f66977a0 (diff) | |
| download | zig-35d3444e2742faa3c2e805cdcbfeceaf0287eefc.tar.gz zig-35d3444e2742faa3c2e805cdcbfeceaf0287eefc.zip | |
more intuitive left shift and right shift operators
Before:
* << is left shift, not allowed to shift 1 bits out
* <<% is left shift, allowed to shift 1 bits out
* >> is right shift, allowed to shift 1 bits out
After:
* << is left shift, allowed to shift 1 bits out
* >> is right shift, allowed to shift 1 bits out
* @shlExact is left shift, not allowed to shift 1 bits out
* @shrExact is right shift, not allowed to shift 1 bits out
Closes #413
Diffstat (limited to 'std/math/log10.zig')
| -rw-r--r-- | std/math/log10.zig | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/std/math/log10.zig b/std/math/log10.zig index 144698b0cd..e9efc0c298 100644 --- a/std/math/log10.zig +++ b/std/math/log10.zig @@ -38,7 +38,7 @@ fn log10_32(x_: f32) -> f32 { // x < 2^(-126) if (ix < 0x00800000 or ix >> 31 != 0) { // log(+-0) = -inf - if (ix <<% 1 == 0) { + if (ix << 1 == 0) { return -math.inf(f32); } // log(-#) = nan @@ -100,7 +100,7 @@ fn log10_64(x_: f64) -> f64 { if (hx < 0x00100000 or hx >> 31 != 0) { // log(+-0) = -inf - if (ix <<% 1 == 0) { + if (ix << 1 == 0) { return -math.inf(f32); } // log(-#) = nan @@ -139,7 +139,7 @@ fn log10_64(x_: f64) -> f64 { // hi + lo = f - hfsq + s * (hfsq + R) ~ log(1 + f) var hi = f - hfsq; var hii = @bitCast(u64, hi); - hii &= u64(@maxValue(u64)) <<% 32; + hii &= u64(@maxValue(u64)) << 32; hi = @bitCast(f64, hii); const lo = f - hi - hfsq + s * (hfsq + R); |
