Is this a bug or am I missing something?

you have to use @floatFromInt.

const float: f64 = @floatFromInt(int);
2 Likes