Skip to content

[native-image] Generating random numbers #1610

@tomekw

Description

@tomekw

I wanted to get a random element from a sequence using (rand-nth seq) but I was always getting the same value. After digging into to the source code I figured out it uses (. Math (random)) under the hood.

I've prepared a sample repo to reproduce the issue. It can be found here: https://github.com/tomekw/random

I had to initialize the main class at build time to compile the project. Maybe that's the cause?

EDIT: I'm on GraalVM 19.1.1 CE and on MacOS

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions