I'm still a bit confused by &[f32; N] notation. In the above, how do I construct something that looks like
[
[ 1, 0, 0, 0]
[ 0, 1, 0, 0]
[0, 0, 1, 0]
[0, 0, 0, 1]
]
I'm still a bit confused by &[f32; N] notation. In the above, how do I construct something that looks like
[
[ 1, 0, 0, 0]
[ 0, 1, 0, 0]
[0, 0, 1, 0]
[0, 0, 0, 1]
]
let x = [[1, 0, 0, 0],
[0, 1, 0, 0],
[0, 0, 1, 0],
[0, 0, 0, 1]];
Your problem is, that 1
is not a f32
, but instead an {integer}
. If you write 1.0
and 0.0
everything will be fine.
Resolved. Thanks everyone!