update more of the std lib to use @as

This commit is contained in:
Andrew Kelley
2019-11-07 18:52:09 -05:00
parent a2acc27872
commit aa0daea541
28 changed files with 145 additions and 145 deletions

View File

@@ -8,7 +8,7 @@ const Complex = cmath.Complex;
pub fn acos(z: var) Complex(@typeOf(z.re)) {
const T = @typeOf(z.re);
const q = cmath.asin(z);
return Complex(T).new(T(math.pi) / 2 - q.re, -q.im);
return Complex(T).new(@as(T, math.pi) / 2 - q.re, -q.im);
}
const epsilon = 0.0001;

View File

@@ -65,7 +65,7 @@ fn frexp_exp64(x: f64, expt: *i32) f64 {
fn ldexp_cexp64(z: Complex(f64), expt: i32) Complex(f64) {
var ex_expt: i32 = undefined;
const exp_x = frexp_exp64(z.re, &ex_expt);
const exptf = i64(expt + ex_expt);
const exptf = @as(i64, expt + ex_expt);
const half_expt1 = @divTrunc(exptf, 2);
const scale1 = @bitCast(f64, (0x3ff + half_expt1) << 20);