casting from smaller to larger integer
Good evening, sorry for making a whole post about something so basic but I'm honestly stumped. I just started using mojo today, past experience is a lot of rust and some c, and I can't figure out how to cast between integer types. Every type parameter I try plugging into the cast method is wrong, I couldn't find anything else that sounded right in the library docs, and kapa.ai comes up empty handed.
1 Reply
DType is the actual underlying type, which can be DType.uint8, DType.uint64, etc, this is a type and NOT a value
When you indicate a type in Mojo, say : UInt8, you are actually indicating that the value has the type SIMD[DType.uint8, 1], rather than DType.uint8, I hope that helps.