Skip to content

Conversation

@im-0
Copy link

@im-0 im-0 commented Sep 8, 2025

Implementations of Distribution<T> for StandardUniform for all SIMD types containing isize and usize now generate random values using fill_bytes().

Uniform distribution for isize and usize was removed from rand crate. See rust-random/rand#1487 for details.

There is a new UniformUsize distribution, but it is limited to a maximum value under u32::MAX for portability across 32/64bits and for use as array indexes and lengths. Probably it is not suitable if a real uniform distribution is required.

Note that this is a breaking change. nalgebra already updated rand to 0.9 in dimforge/nalgebra@2da148c.

@im-0
Copy link
Author

im-0 commented Sep 20, 2025

I renamed new macro to not shadow the old one.

Also disabled new functions unless feature = "portable_simd" is enabled. (was a mistake, reverted)

Implementations of `Distribution<T> for StandardUniform` for all
SIMD types containing `isize` and `usize` now generate random
values using `fill_bytes()`.

Uniform distribution for `isize` and `usize` was removed from `rand` crate.
See rust-random/rand#1487 for details.

There is a new `UniformUsize` distribution, but it is limited to a
maximum value under u32::MAX for portability across 32/64bits and for
use as array indexes and lengths. Probably it is not suitable if a real
uniform distribution is required.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant