aboutsummaryrefslogtreecommitdiff
path: root/std/math
diff options
context:
space:
mode:
Diffstat (limited to 'std/math')
-rw-r--r--std/math/atan.zig12
-rw-r--r--std/math/big/int.zig6
-rw-r--r--std/math/big/rational.zig4
-rw-r--r--std/math/exp.zig4
-rw-r--r--std/math/exp2.zig4
5 files changed, 15 insertions, 15 deletions
diff --git a/std/math/atan.zig b/std/math/atan.zig
index cc4cad0dd4..5790eba8cf 100644
--- a/std/math/atan.zig
+++ b/std/math/atan.zig
@@ -23,21 +23,21 @@ pub fn atan(x: var) @typeOf(x) {
}
fn atan32(x_: f32) f32 {
- const atanhi = []const f32{
+ const atanhi = [_]f32{
4.6364760399e-01, // atan(0.5)hi
7.8539812565e-01, // atan(1.0)hi
9.8279368877e-01, // atan(1.5)hi
1.5707962513e+00, // atan(inf)hi
};
- const atanlo = []const f32{
+ const atanlo = [_]f32{
5.0121582440e-09, // atan(0.5)lo
3.7748947079e-08, // atan(1.0)lo
3.4473217170e-08, // atan(1.5)lo
7.5497894159e-08, // atan(inf)lo
};
- const aT = []const f32{
+ const aT = [_]f32{
3.3333328366e-01,
-1.9999158382e-01,
1.4253635705e-01,
@@ -114,21 +114,21 @@ fn atan32(x_: f32) f32 {
}
fn atan64(x_: f64) f64 {
- const atanhi = []const f64{
+ const atanhi = [_]f64{
4.63647609000806093515e-01, // atan(0.5)hi
7.85398163397448278999e-01, // atan(1.0)hi
9.82793723247329054082e-01, // atan(1.5)hi
1.57079632679489655800e+00, // atan(inf)hi
};
- const atanlo = []const f64{
+ const atanlo = [_]f64{
2.26987774529616870924e-17, // atan(0.5)lo
3.06161699786838301793e-17, // atan(1.0)lo
1.39033110312309984516e-17, // atan(1.5)lo
6.12323399573676603587e-17, // atan(inf)lo
};
- const aT = []const f64{
+ const aT = [_]f64{
3.33333333333329318027e-01,
-1.99999999998764832476e-01,
1.42857142725034663711e-01,
diff --git a/std/math/big/int.zig b/std/math/big/int.zig
index 008780b228..adc22ffa34 100644
--- a/std/math/big/int.zig
+++ b/std/math/big/int.zig
@@ -415,13 +415,13 @@ pub const Int = struct {
i += 1;
}
- const ap_base = Int.initFixed(([]Limb{base})[0..]);
+ const ap_base = Int.initFixed(([_]Limb{base})[0..]);
try self.set(0);
for (value[i..]) |ch| {
const d = try charToDigit(ch, base);
- const ap_d = Int.initFixed(([]Limb{d})[0..]);
+ const ap_d = Int.initFixed(([_]Limb{d})[0..]);
try self.mul(self.*, ap_base);
try self.add(self.*, ap_d);
@@ -828,7 +828,7 @@ pub const Int = struct {
// Trunc -> Floor.
if (!q.isPositive()) {
- const one = Int.initFixed(([]Limb{1})[0..]);
+ const one = Int.initFixed(([_]Limb{1})[0..]);
try q.sub(q.*, one);
try r.add(q.*, one);
}
diff --git a/std/math/big/rational.zig b/std/math/big/rational.zig
index 58a5e3ac76..27a3b7300f 100644
--- a/std/math/big/rational.zig
+++ b/std/math/big/rational.zig
@@ -102,7 +102,7 @@ pub const Rational = struct {
if (point) |i| {
try self.p.setString(10, str[0..i]);
- const base = Int.initFixed(([]Limb{10})[0..]);
+ const base = Int.initFixed(([_]Limb{10})[0..]);
var j: usize = start;
while (j < str.len - i - 1) : (j += 1) {
@@ -452,7 +452,7 @@ pub const Rational = struct {
try gcd(&a, r.p, r.q);
r.p.setSign(sign);
- const one = Int.initFixed(([]Limb{1})[0..]);
+ const one = Int.initFixed(([_]Limb{1})[0..]);
if (a.cmp(one) != 0) {
var unused = try Int.init(r.p.allocator.?);
defer unused.deinit();
diff --git a/std/math/exp.zig b/std/math/exp.zig
index ad058646a4..718bbcd476 100644
--- a/std/math/exp.zig
+++ b/std/math/exp.zig
@@ -24,7 +24,7 @@ pub fn exp(x: var) @typeOf(x) {
}
fn exp32(x_: f32) f32 {
- const half = []f32{ 0.5, -0.5 };
+ const half = [_]f32{ 0.5, -0.5 };
const ln2hi = 6.9314575195e-1;
const ln2lo = 1.4286067653e-6;
const invln2 = 1.4426950216e+0;
@@ -99,7 +99,7 @@ fn exp32(x_: f32) f32 {
}
fn exp64(x_: f64) f64 {
- const half = []const f64{ 0.5, -0.5 };
+ const half = [_]f64{ 0.5, -0.5 };
const ln2hi: f64 = 6.93147180369123816490e-01;
const ln2lo: f64 = 1.90821492927058770002e-10;
const invln2: f64 = 1.44269504088896338700e+00;
diff --git a/std/math/exp2.zig b/std/math/exp2.zig
index 07a39576b1..57f6620d77 100644
--- a/std/math/exp2.zig
+++ b/std/math/exp2.zig
@@ -22,7 +22,7 @@ pub fn exp2(x: var) @typeOf(x) {
};
}
-const exp2ft = []const f64{
+const exp2ft = [_]f64{
0x1.6a09e667f3bcdp-1,
0x1.7a11473eb0187p-1,
0x1.8ace5422aa0dbp-1,
@@ -96,7 +96,7 @@ fn exp2_32(x: f32) f32 {
return @floatCast(f32, r * uk);
}
-const exp2dt = []f64{
+const exp2dt = [_]f64{
// exp2(z + eps) eps
0x1.6a09e667f3d5dp-1, 0x1.9880p-44,
0x1.6b052fa751744p-1, 0x1.8000p-50,