#Math intrinics and peer resolution

1 messages · Page 1 of 1 (latest)

wanton ridge
#

yeah this looks like a bug of not respecting the size associated with constants with type resolution. you can see it still happening when you inline it:

    const max1 = @max(@as(u32, 900), 10);
    std.debug.print("max1: {s}\n", .{@typeName(@TypeOf(max1))});

and when you use var, it respects the types:

    var a: u32 = 900;
    const max1 = @max(a, 10);
    std.debug.print("max1: {s}\n", .{@typeName(@TypeOf(max1))});
#

well, I suppose it could be considered valid

#

u10 would work everywhere where u16 should unless if you're doing type magic