authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-10-16 19:16:39-04:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-10-16 19:16:57-04:00
logf80c01f9d8367ee904d8e01666cd6136dafd6213
tree716527e403f2464f9feb627f976e604c29ec556d
parent7598a579ff5f4db43a53c4a466b4b37263726b4b
signaturelock-open Commit is signed but in an unrecognized format.

ref more math decls for better docs


3 files changed, 10 insertions(+), 113 deletions(-)

lib/std/math.zig+2-48
......@@ -202,54 +202,8 @@ pub const Complex = complex.Complex;
202202
203203pub const big = @import("math/big.zig");
204204
205test "math" {
206 _ = @import("math/nan.zig");
207 _ = @import("math/isnan.zig");
208 _ = @import("math/fabs.zig");
209 _ = @import("math/ceil.zig");
210 _ = @import("math/floor.zig");
211 _ = @import("math/trunc.zig");
212 _ = @import("math/round.zig");
213 _ = @import("math/frexp.zig");
214 _ = @import("math/modf.zig");
215 _ = @import("math/copysign.zig");
216 _ = @import("math/isfinite.zig");
217 _ = @import("math/isinf.zig");
218 _ = @import("math/isnormal.zig");
219 _ = @import("math/signbit.zig");
220 _ = @import("math/scalbn.zig");
221 _ = @import("math/pow.zig");
222 _ = @import("math/powi.zig");
223 _ = @import("math/sqrt.zig");
224 _ = @import("math/cbrt.zig");
225 _ = @import("math/acos.zig");
226 _ = @import("math/asin.zig");
227 _ = @import("math/atan.zig");
228 _ = @import("math/atan2.zig");
229 _ = @import("math/hypot.zig");
230 _ = @import("math/exp.zig");
231 _ = @import("math/exp2.zig");
232 _ = @import("math/expm1.zig");
233 _ = @import("math/ilogb.zig");
234 _ = @import("math/ln.zig");
235 _ = @import("math/log.zig");
236 _ = @import("math/log2.zig");
237 _ = @import("math/log10.zig");
238 _ = @import("math/log1p.zig");
239 _ = @import("math/fma.zig");
240 _ = @import("math/asinh.zig");
241 _ = @import("math/acosh.zig");
242 _ = @import("math/atanh.zig");
243 _ = @import("math/sinh.zig");
244 _ = @import("math/cosh.zig");
245 _ = @import("math/tanh.zig");
246 _ = @import("math/sin.zig");
247 _ = @import("math/cos.zig");
248 _ = @import("math/tan.zig");
249
250 _ = @import("math/complex.zig");
251
252 _ = @import("math/big.zig");
205comptime {
206 std.meta.refAllDecls(@This());
253207}
254208
255209pub fn floatMantissaBits(comptime T: type) comptime_int {
lib/std/meta.zig+6
......@@ -552,3 +552,9 @@ pub fn fieldIndex(comptime T: type, comptime name: []const u8) ?comptime_int {
552552 }
553553 return null;
554554}
555
556/// Given a type, reference all the declarations inside, so that the semantic analyzer sees them.
557pub fn refAllDecls(comptime T: type) void {
558 if (!builtin.is_test) return;
559 _ = declarations(T);
560}
lib/std/std.zig+2-65
......@@ -62,69 +62,6 @@ pub const unicode = @import("unicode.zig");
6262pub const valgrind = @import("valgrind.zig");
6363pub const zig = @import("zig.zig");
6464
65// Reference everything so it gets tested.
66test "" {
67 _ = AlignedArrayList;
68 _ = ArrayList;
69 _ = AutoHashMap;
70 _ = BloomFilter;
71 _ = BufMap;
72 _ = BufSet;
73 _ = Buffer;
74 _ = BufferOutStream;
75 _ = DynLib;
76 _ = HashMap;
77 _ = Mutex;
78 _ = PackedIntArrayEndian;
79 _ = PackedIntArray;
80 _ = PackedIntSliceEndian;
81 _ = PackedIntSlice;
82 _ = PriorityQueue;
83 _ = SinglyLinkedList;
84 _ = StaticallyInitializedMutex;
85 _ = SegmentedList;
86 _ = SpinLock;
87 _ = StringHashMap;
88 _ = ChildProcess;
89 _ = TailQueue;
90 _ = Thread;
91
92 _ = atomic;
93 _ = base64;
94 _ = build;
95 _ = c;
96 _ = coff;
97 _ = crypto;
98 _ = cstr;
99 _ = debug;
100 _ = dwarf;
101 _ = elf;
102 _ = event;
103 _ = fmt;
104 _ = fs;
105 _ = hash;
106 _ = hash_map;
107 _ = heap;
108 _ = http;
109 _ = io;
110 _ = json;
111 _ = lazyInit;
112 _ = macho;
113 _ = math;
114 _ = mem;
115 _ = meta;
116 _ = net;
117 _ = os;
118 _ = packed_int_array;
119 _ = pdb;
120 _ = process;
121 _ = rand;
122 _ = rb;
123 _ = sort;
124 _ = ascii;
125 _ = testing;
126 _ = time;
127 _ = unicode;
128 _ = valgrind;
129 _ = zig;
65comptime {
66 meta.refAllDecls(@This());
13067}