authorgravatar for emekankurumeh@outlook.comemekoi <emekankurumeh@outlook.com> 2019-06-28 16:01:49-05:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2019-06-29 13:21:27-04:00
log92b68c57b3329418c8e799e60e37fd00674704e5
tree86a164ff6fd745b44a48716870f8c1e9e89d62d7
parent8156a61de898c1ebcf4b70da21618452507591cd

fix formatting


1 files changed, 105 insertions(+), 27 deletions(-)

std/special/c.zig+105-27
...@@ -146,7 +146,7 @@ export fn bcmp(vl: [*]allowzero const u8, vr: [*]allowzero const u8, n: usize) i...@@ -146,7 +146,7 @@ export fn bcmp(vl: [*]allowzero const u8, vr: [*]allowzero const u8, n: usize) i
146 var index: usize = 0;146 var index: usize = 0;
147 while (index != n) : (index += 1) {147 while (index != n) : (index += 1) {
148 if (vl[index] != vr[index]) {148 if (vl[index] != vr[index]) {
149 return 1;149 return 1;
150 }150 }
151 }151 }
152152
...@@ -254,32 +254,110 @@ export fn fmod(x: f64, y: f64) f64 {...@@ -254,32 +254,110 @@ export fn fmod(x: f64, y: f64) f64 {
254254
255// TODO add intrinsics for these (and probably the double version too)255// TODO add intrinsics for these (and probably the double version too)
256// and have the math stuff use the intrinsic. same as @mod and @rem256// and have the math stuff use the intrinsic. same as @mod and @rem
257export fn floorf(x: f32) f32 {return math.floor(x);}257export fn floorf(x: f32) f32 {
258export fn ceilf(x: f32) f32 {return math.ceil(x);}258 return math.floor(x);
259export fn floor(x: f64) f64 {return math.floor(x);}259}
260export fn ceil(x: f64) f64 {return math.ceil(x);}260
261export fn fma(a: f64, b: f64, c: f64) f64 {return math.fma(f64, a, b, c);}261export fn ceilf(x: f32) f32 {
262export fn fmaf(a: f32, b: f32, c: f32) f32 {return math.fma(f32, a, b, c);}262 return math.ceil(x);
263export fn sin(a: f64) f64 {return math.sin(a);}263}
264export fn sinf(a: f32) f32 {return math.sin(a);}264
265export fn cos(a: f64) f64 {return math.cos(a);}265export fn floor(x: f64) f64 {
266export fn cosf(a: f32) f32 {return math.cos(a);}266 return math.floor(x);
267export fn exp(a: f64) f64 {return math.exp(a);}267}
268export fn expf(a: f32) f32 {return math.exp(a);}268
269export fn exp2(a: f64) f64 {return math.exp2(a);}269export fn ceil(x: f64) f64 {
270export fn exp2f(a: f32) f32 {return math.exp2(a);}270 return math.ceil(x);
271export fn log(a: f64) f64 {return math.ln(a);}271}
272export fn logf(a: f32) f32 {return math.ln(a);}272
273export fn log2(a: f64) f64 {return math.log2(a);}273export fn fma(a: f64, b: f64, c: f64) f64 {
274export fn log2f(a: f32) f32 {return math.log2(a);}274 return math.fma(f64, a, b, c);
275export fn log10(a: f64) f64 {return math.log10(a);}275}
276export fn log10f(a: f32) f32 {return math.log10(a);}276
277export fn fabs(a: f64) f64 {return math.fabs(a);}277export fn fmaf(a: f32, b: f32, c: f32) f32 {
278export fn fabsf(a: f32) f32 {return math.fabs(a);}278 return math.fma(f32, a, b, c);
279export fn trunc(a: f64) f64 {return math.trunc(a);}279}
280export fn truncf(a: f32) f32 {return math.trunc(a);}280
281export fn round(a: f64) f64 {return math.round(a);}281export fn sin(a: f64) f64 {
282export fn roundf(a: f32) f32 {return math.round(a);}282 return math.sin(a);
283}
284
285export fn sinf(a: f32) f32 {
286 return math.sin(a);
287}
288
289export fn cos(a: f64) f64 {
290 return math.cos(a);
291}
292
293export fn cosf(a: f32) f32 {
294 return math.cos(a);
295}
296
297export fn exp(a: f64) f64 {
298 return math.exp(a);
299}
300
301export fn expf(a: f32) f32 {
302 return math.exp(a);
303}
304
305export fn exp2(a: f64) f64 {
306 return math.exp2(a);
307}
308
309export fn exp2f(a: f32) f32 {
310 return math.exp2(a);
311}
312
313export fn log(a: f64) f64 {
314 return math.ln(a);
315}
316
317export fn logf(a: f32) f32 {
318 return math.ln(a);
319}
320
321export fn log2(a: f64) f64 {
322 return math.log2(a);
323}
324
325export fn log2f(a: f32) f32 {
326 return math.log2(a);
327}
328
329export fn log10(a: f64) f64 {
330 return math.log10(a);
331}
332
333export fn log10f(a: f32) f32 {
334 return math.log10(a);
335}
336
337export fn fabs(a: f64) f64 {
338 return math.fabs(a);
339}
340
341export fn fabsf(a: f32) f32 {
342 return math.fabs(a);
343}
344
345export fn trunc(a: f64) f64 {
346 return math.trunc(a);
347}
348
349export fn truncf(a: f32) f32 {
350 return math.trunc(a);
351}
352
353export fn round(a: f64) f64 {
354 return math.round(a);
355}
356
357export fn roundf(a: f32) f32 {
358 return math.round(a);
359}
360
283fn generic_fmod(comptime T: type, x: T, y: T) T {361fn generic_fmod(comptime T: type, x: T, y: T) T {
284 @setRuntimeSafety(false);362 @setRuntimeSafety(false);
285363