master
1const std = @import("std");
2const builtin = @import("builtin");
3const expect = std.testing.expect;
4const mem = std.mem;
5
6test "integer widening" {
7 const a: u8 = 250;
8 const b: u16 = a;
9 const c: u32 = b;
10 const d: u64 = c;
11 const e: u64 = d;
12 const f: u128 = e;
13 try expect(f == a);
14}
15
16test "implicit unsigned integer to signed integer" {
17 const a: u8 = 250;
18 const b: i16 = a;
19 try expect(b == 250);
20}
21
22test "float widening" {
23 const a: f16 = 12.34;
24 const b: f32 = a;
25 const c: f64 = b;
26 const d: f128 = c;
27 try expect(d == a);
28}
29
30// test