Search
Star
Feedback
Setup for Free
© 2026 Hedgehog Software, LLC
Twitter
GitHub
Discord
System
Light
Dark
More
Communities
Docs
About
Terms
Privacy
How to random int ?? - Modular
M
Modular
•
2y ago
•
4 replies
Firas
How to random int ??
I have very simple
:
results
= DTypePointer
[type
]
.alloc
(batch
* cols
)
how to generate random idex
(int
) in
[0
,batch
* cols
]
?
?
?
all the random function in mojo returns SIMD
,
how to convert simd to regular Int
?
Modular
Join
This server is the home of the MAX and Mojo community! Join us to chat about all things Modular.
20,199
Members
View on Discord
Resources
ModelContextProtocol
ModelContextProtocol
MCP Server
Recent Announcements
Similar Threads
Was this page helpful?
Yes
No
Similar Threads
Error:cannot construct 'Array' from 'ListLiteral[Int, Int, Int, Int, Int]' value in 'var' initialize
M
Modular / questions
3y ago
Branchless way to convert bool to int?
M
Modular / questions
3y ago
How to initialize a tensor[DType.int8] with random values of either: -1, 0, or 1?
M
Modular / questions
2y ago
How to convert a byte to integer?
M
Modular / questions
3y ago