mirror of
https://github.com/ziglang/zig.git
synced 2026-02-14 13:30:45 +00:00
Merge remote-tracking branch 'origin/master' into copy-elision-3
This commit is contained in:
commit
65997f816b
@ -3787,7 +3787,7 @@ test "fn reflection" {
|
||||
However right now it is hard coded to be a {#syntax#}u16{#endsyntax#}. See <a href="https://github.com/ziglang/zig/issues/786">#768</a>.
|
||||
</p>
|
||||
<p>
|
||||
You can {#link|implicitly cast|Implicit Casts#} an error from a subset to its superset:
|
||||
You can {#link|implicitly cast|Implicit Casts#} an error from a subset to a superset:
|
||||
</p>
|
||||
{#code_begin|test#}
|
||||
const std = @import("std");
|
||||
|
||||
@ -37,7 +37,7 @@ const mach_hdr = if (@sizeOf(usize) == 8) mach_header_64 else mach_header;
|
||||
pub extern "c" var _mh_execute_header: mach_hdr = undefined;
|
||||
comptime {
|
||||
if (std.os.darwin.is_the_target) {
|
||||
@export("__mh_execute_header", _mh_execute_header, .Weak);
|
||||
@export("_mh_execute_header", _mh_execute_header, .Weak);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
11
std/math.zig
11
std/math.zig
@ -482,7 +482,16 @@ fn testAbsInt() void {
|
||||
testing.expect((absInt(i32(10)) catch unreachable) == 10);
|
||||
}
|
||||
|
||||
pub const absFloat = @import("fabs.zig").fabs;
|
||||
pub const absFloat = fabs;
|
||||
|
||||
test "math.absFloat" {
|
||||
testAbsFloat();
|
||||
comptime testAbsFloat();
|
||||
}
|
||||
fn testAbsFloat() void {
|
||||
testing.expect(absFloat(f32(-10.05)) == 10.05);
|
||||
testing.expect(absFloat(f32(10.05)) == 10.05);
|
||||
}
|
||||
|
||||
pub fn divTrunc(comptime T: type, numerator: T, denominator: T) !T {
|
||||
@setRuntimeSafety(false);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user